Plugin development with unit tests

The unit tests transform all CREATE TABLE and DROP TABLE queries to CREATE TEMPORARY TABLE and DROP TEMPORARY TALBE, respectively. So in your tearDown the query will attempt to drop temporary tables with those names, but not the actual tables. To fix this, add this before your DROP queries: remove_filter( ‘query’, array( $this, ‘_drop_temporary_tables’ ) … Read more

WordPress for a very large website

…would WordPress be able to render the website in less than one second… WordPress is perfectly scalable to the amount of content and user base you’re describing. You just need the horsepower for httpd (apache/nginx) to be able show one second page loads and have the database server (mysql, maria) respond fast, too. You also … Read more

Has anyone tried putting PHP ActiveRecord on WordPress?

If you plan to use it just for your own code, and have it running alongside WordPress’ default database driver (wpdb), I see no real problems. It’s only if you plan on fully integrating/overriding WP’s driver that I see it being near-impossible; hard-coded SQL is prolific throughout core, and translating them to ActiveRecord method calls … Read more

How do I check what plugins are enabled via the database?

You can do it like this: SQL SELECT * FROM wp_options WHERE option_name=”active_plugins”; But for better approach will be the WordPress way: WordPress if ( ! function_exists( ‘get_plugins’ ) ) { require_once ABSPATH . ‘wp-admin/includes/plugin.php’; } $active_plugins = get_option(‘active_plugins’); $all_plugins = get_plugins(); $activated_plugins = array(); foreach ($active_plugins as $plugin){ if(isset($all_plugins[$plugin])){ array_push($activated_plugins, $all_plugins[$plugin]); } }

How to reset the post ID increment

I also happened to me once, I only had like 10 real post, so what I did was to go to phpMyAdmin, make sure your that on my wp_posts and wp_posts_meta tables are only information about the 10 real posts IDs, from the mysite/wp-admin/export.php I exported all the posts (10 of them), I run the … Read more