background preloader

Wordpress

Facebook Twitter

How to monitor and reduce WordPress memory usage by plugins - Stu Miller. One of the best things about WordPress is that it’s so easy to extend your site’s functionality with the many (mostly) free plugins available on the plugin repository. But loading your site with too many plugins can cause your site to consume too many resources on your server, slowing your site down. So how do you find out what resources your plugins are consuming to help you reduce WordPress memory usage and speed up your site?

Reduce WordPress memory usage by plugins In a WordPress page request, the point at which plugins are loaded depends on how they’ve been coded. WordPress runs through a series of typical actions on every request. You can see these actions here, including the order in which they are run. A plugin developer decided where in this their plugin is needed, depending on the functionality the plugin offers, and ‘hooks’ into one of these actions, overiding or extending the default WordPress functionality with their custom code. 1) P3 (Plugin Performance Profiler) 40+ Free Responsive WordPress Themes. Not every blogger or site owner is code-literate or design-savvy, but everyone deserves to get a responsive design for their site.

If you’re on WordPress, have we got a treat for you. Rather than bust your budget to hire a designer for a revamp, why not adopt one of these handpicked WordPress Themes that are available for free? These themes are built to resize and realign itself to cater to the different screen sizes of mobile devices, such as smartphones and tablets, i.e. they are responsive. No more swiping around to find hidden sidebars, zooming in and out to make the text comfortable enough to read. After all this, the look and feel of the site will still be maintained to mirror the original site. In this showcase, we are featuring 40+ of responsive WordPress themes you can play around with. There will definitely be more out there so if you have a favorite theme, do let us know in the comments below. Constellation [ Demo | Download ] Flexible [ Demo | Download ] Ari [ Demo | Download ]

Extending the WordPress XML-RPC API | SkyVerge. The purpose of this article is to describe the WordPress XML-RPC API, explain how to use it, and demonstrate how to extend it to create custom API methods for interacting programmatically with WordPress. I assume a relative unfamiliarity with XML-RPC in general, WordPress XML-RPC, and spend time first covering the basics, if you want to skip straight to the section on extending the WordPress XML-RPC API, feel free to. What is XML-RPC? As defined by the wikipedia article: XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism. XML-RPC provides a means of remotely calling methods on a target system, and is simpler to understand and implement in general than SOAP.

It’s an ideal way to programmatically interact with WordPress as XML-RPC is supported in the WordPress core. An XML-RPC client can be written in virtually any programming language, making it a very flexible choice for an API implementation. Request: Response: WordPress Unit Tests Sprint: A Primer - Max Cutler. WordPress 3.4 finally shipped a few weeks ago, and now attention turns to 3.5. Feature discussions will start at the July 11 IRC dev chat, but in the meantime there will be a sprint to revise the unit tests suite. This post is to serve as starting guidance for the contributors who will be helping in this sprint. For background, you can read the kickoff IRC chat logs. First, a quick review of the current unit test suite.

Nikolay’s Clean Slate About a year ago, Nikolay Bachiyski started a new project to rethink how the unit tests are organized and run. Fasterruns every test case in a clean WordPress installuses the default PHPUnit runner, instead of a custom onedoesn’t encourage or support the usage of shared/prebuilt fixturesuses SQL transactions to clean up automatically after each test Many of us contributors felt strongly that this was a better direction for the test suite, and have been experimenting with branches of Nikolay’s code over the past months.

Architecture Overview Coordination. Unit Testing WordPress Plugins: The Right Way. Whether you are currently writing a WordPress plugin and have decided to embrace unit testing or you are about to begin development of a plugin and want to unit test it from the start, learning how to do it correctly is a must. This guide assumes you have a working LAMP stack (or similar) setup on your development machine and have reasonable knowledge of databases. For easy set up of a LAMP stack see XAMMP (windows/linux) or MAMP (Mac). You should also have Git installed. Unit Testing Overview Unit testing is a great way to ensure that everything is working as expected. Write a failing test.Write code so that the test passes.Refactor.

Hopefully you’re reasonably familiar with that process. The Problem With Standard Practices If you try to go about unit testing your plugin using the standard means that you would with any other app then you are likely going to fail. Using The WordPress-Tests Library Getting Set Up Firstly you need PHPUnit. Now to set up your environment. <? <? Creating the Tests. The Beginner's Guide to Unit Testing: Building a Testable Plugin. In the first part of this series, we took a high-level look at testing methodologies and gave some cases as to why it's beneficial for us to begin doing in our WordPress projects. We also took time to setup PHPUnit and the WordPress Tests in order to begin building our first testable plugin. In this final article, we're going to define a methodology for unit testing, begin incorporating it into our work, and walk away with a fully functional (albeit simple) plugin that also has a small set of tests to ensure that it works exactly as expected.

When it comes to testing, there are generally two ways to do it: Write your tests, then write code to make your tests passWrite your code, then write tests that pass In my experience, the first approach is always better. To that end, I find it better to write the tests first. With that in mind, we're going to be building with this simple methodology: Write a test and run it.

Let's stub out the unit test class: At this point, you should see a failure: WordPress Flow Charts & Diagrams | Tom J Nowell. Quickly Disable or Enable All WordPress Plugins via the Database. Recently, while dealing with the dreaded white screen of death, I found myself unable to login to the WordPress Admin area to manually disable all of the plugins used here at Perishable Press. In the past, I have dealt with this situation by simply deleting all plugin files from the server, however this time, time was of the essence — I had only a few minutes with which to troubleshoot, diagnose, and ultimately resolve the deadly white-screen syndrome. Fortunately, after a few minutes of digging through the WordPress Codex, I had discovered enough information to successfully complete my mission. Now that the fiasco is over, I want to share a simple technique for quickly disabling and (re-)enabling your entire set of WordPress plugins. In the blink of an eye.. Before beginning, make a backup copy of your database.

SELECT * FROM wp_options WHERE option_name = 'active_plugins'; Once the active_plugins column appears, click to edit it. Nuke ‘em! Updated Method. WordPress constants overview. Class Reference/WP List Table. Class Reference/WP List Table This class's access is marked as private. That means it is not intended for use by plugin and theme developers as it is subject to change without warning in any future WordPress release. If you would still like to make use of the class, you should make a copy to use and distribute with your own project, or else use it at your own risk.

Role of WP_List_Table This class is used to generate the List Tables that populate WordPress' various admin screens. Developer Usage & Private Status On March 27, 2012, Andrew Nacin warned developers that this class was created for private core use only as it may be subject to change in any future WordPress release. Nevertheless, the WP_List_Table class has become widely used by plugins and WordPress developers as it provides a reliable, consistent, and semantic way to create custom list tables in WordPress.

Developers should use this class at their own risk. Usage In the WordPress Core Developer Usage Methods and Properties $items. How To Design And Style Your WordPress Plugin Admin Panel. The great thing about WordPress is that it's highly customizable and flexible. Within a WordPress plugin, almost all of the fields could be change to your desire results. When you are building a WordPress Plugin, chances are there is a need for you to create some admin pages for the users to customize the setting they want. WordPress admin default has their own CSS style and you can make use of it for your WordPress Plugin Admin Panel if you require one. If you require additional styling for your admin panel, you can also link in an external CSS stylesheet within your plugin.

Below, we'll show you some default WordPress CSS styling and how to link in an external CSS stylesheet. Basic WordPress Admin Panel To get started, first you will need to have the markup for the right container, so that your WordPress Plugin admin page will sit nicely at the right side. Example WordPress Headers And Buttons How To Have An Icon For The Header How To Create WordPress Form Fields How To Add In New CSS Style.