Hot answers tagged

16

If you need to get the wordpress version in your script, there is a global variable: $wp_version (right now it's something like '3.1-RC3-17376') It contains the wordpress version. If you need to acquire if from a file, you can read it from /wp-includes/version.php: function getWPVersion() { $path = '/path/to/wp-install'; include $path.'/wp-...


14

grep wp_version wp-includes/version.php


14

The only reason why the 3.3.3 milestone was marked as completed is because leaving the milestone open interfered with our ticket reports for 3.4.1. (I forgot that milestone closures are reflected in the timeline.) Generally speaking, we assign tickets to the next minor milestone if they are reporting an immediate regression. So, a regression in 3.2 that ...


11

You can hook into style_loader_src and script_loader_src and run remove_query_arg( 'ver', $url ) on the URL: <?php /* Plugin Name: Remove version parameter for scripts and styles */ add_filter( 'style_loader_src', 't5_remove_version' ); add_filter( 'script_loader_src', 't5_remove_version' ); function t5_remove_version( $url ) { return ...


10

Always write plugins for the current version and keep the nightly builds from the upcoming versions in mind. Anything else doesn't matter. Edit As @toscho pointed out in a comment: There might be some explanation needed to why it is that way. Because I say so. Plugins only need to be compliant with core because if all play with the rules, nothing will ...


9

This is a bit of code I wrote a while back to do WP version detection in the most obvious ways: http://ottodestruct.com/class-wp-detection.phps There are other methods, more subtle and less obvious. His method is file fingerprinting. Basically checking for whether certain files exist or not.


8

I just found a solution as an automated service over at http://de.wpseek.com/pluginfilecheck/ It's does exactly, what was asked for including the generation of list of used functions and giving a suggestion for the Plugin-Header comments.


7

headdesk Permissions on all WordPress files should be 644. Permissions on all WordPress directories should be 755. Exceptions: The uploads directory may need to be 775 or 777, depending on your server configuration. wp-config.php should be 600, 640, or 644, whatever is the lowest number that works. Never, ever, give higher permissions than those. ...


6

There is a function called get_plugin_data(). Try calling this from within the main plugin file if you need to: $plugin_data = get_plugin_data( __FILE__ ); $plugin_version = $plugin_data['Version']; But as is said in the answers to the other question, its better for performance to just define a PHP variable as you're doing.


6

Supporting old versions of WordPress seems reasonable, but is it really necessary? Personally, I think supporting old versions is waste of efforts and time and it prevents end-users from updating their WordPress installs. What's the point of being a WordPress developer if you're encouraging users to remain using insecure and out-of-date versions? Just ...


6

Go into Settings -> TinyMCE Advanced, and check the option Stop removing the <p> and <br /> tags when saving and show them in the HTML editor. This will allow you full control over those tags inside the HTML view. For a single line break without overriding the editor, use Shift+Enter. To override the editor and make Enter a single line break, ...


6

Always install the latest final version. This is the most secure version you can get. Older tutorials and guides should still mostly apply. If they don’t you will find enough replacements that are up to date.


5

see: http://clark-technet.com/2010/12/wordpress-self-hosted-plugin-update-api Basically the idea is to hook your update checking function to the pre_set_site_transient_update_themes filter. The version array key you return from this function will be compared by WP to the current theme version from style.css.... Use the admin_notices action to make your ...


5

You can also just go to http://example.com/readme.html in a web browser. The readme file ships with every version of WordPress and displays the installed version number prominently at the top of the page. Also, if you can view your site's front-end (I know you said you can't access the dashboard, so I'm just assuming your blog is public), you can "view ...


5

I would only increase the version number if users needed to download the plugin again. The "Tested up to" variable is not used when the plugin is installed, only when people want to install it or want to upgrade. In that case, the information comes from the server anyway, so you don't need to force a new download of your plugin. Of course, if your readme....


5

You can hook on option_update_core and edit the update url, as a plugin you can do something like this (Remember to disable the plugin after updating wordpress) add_filter('option_update_core','wpse_26750'); add_filter('transient_update_core','wpse_26750'); function wpse_26750($options){ global $wp_version; $updates=array( '2.5'=>'http://...


5

Either use a plugin (like wp-maintenance-mode) or hardcode your .htaccess file to redirect to the splash page, and allow your own (or your team) IP address to ignore the redirect. Like this: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1 RewriteCond %{REQUEST_URI} !/splashpage.html$ [NC] RewriteRule .* /...


5

You can find the version in wp-includes/version.php, the $wp_version variable. It can also be found in the readme.html file in the root of the WordPress folder.


5

Remember the release of WordPress 3.0 required PHP5. At the time, many hosting companies were not yet running PHP5 on their servers. So there was a period of time when some WordPress sites COULDN'T update to WordPress 3.0 because their hosting companies were not keeping their servers up to date. Many years have now passed (3+) since the release of ...


5

Most WordPress installations are outdated. Currently, only 5.2% of all installations are running on the latest release 3.6. 27.3% are still on version 3.0. You might think you have to support these old versions with compatible code. But think about the implications: You have to test all officially supported versions. You have to handle incompatible APIs ...


5

After further Googling I was able to come across a site that explains how to achieve this. http://www.virendrachandak.com/techtalk/how-to-remove-wordpress-version-parameter-from-js-and-css-files/ The second function on the page is quite helpful. This looks for "ver=" and checks that it matches the WordPress version number and then removes it. The first ...


5

I would be very afraid to develop on 3.8.1 and try to run the same code on 3.5.1. Things have changed. 3.5.1 is ancient by web app standards. I can't say that I have ever tried to "backport" like that, but it does worry me. Much of your code would work. WordPress itself is pathologically backwards compatible, but if your code uses new features (intentionally ...


5

It's use? I believe Automattic (and others) use it to generate stats on WP deployment worldwide, similar to Joomla and other CMSes. But a lot of the reason people may 'hate' it is because of mis-education. It is a fallacy that it is a security risk. What is a security risk is not keeping your site and plugins up to date - solve that and you don't need to ...


4

First, try disabling all of your plugins, and see if that fixes it. If it does, enable them one at a time until you are able to reproduce the error. That should tell you which plugin is causing the problem. Additionally, I strongly suggest you upgrade to 3.0.1.


4

I just want to add the batch version of this script, as I've spent quite a bit of time till I found this: Use it to print all the versions of all your wordpress install within a folder. find . -name 'version.php' -path '*wp-includes/*' -print -exec grep '$wp_version =' {} \; -exec echo '' \;


4

There's a page in the Codex that shows exactly that: WordPress > About » Statistics But really, it all depends on what features you're using. A safe bet for a new plugin would be to support WordPress 3.1.X and above (since that's the current stable release). You're setting yourself up for a lot of hurt if you try to do too much backwards ...


4

To always get latest plugin take for example my plugin: http://wordpress.org/extend/plugins/wordpress-file-monitor-plus/ the download link for the latest is: http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.1.1.zip but if you remove the version from the download link you always get the latest version: http://downloads.wordpress.org/...


4

Stable release of WP is the one meant for production. Any serious issues (such as security) are addressed via minor releases. Some of the fixes for not that serious issues can be received ahead of schedule with Hotfix plugin. Non-stable versions are usually run by WordPress developers for the sake of experimentation and early access to new features. That is ...


4

If your current plugin version is 1.2.5, and you have a beta version for the next version, it should be called 1.2.6-beta. Your user can install it, and when the real 1.2.6 version is released on the repository, WordPress will notify the user on the Plugins page and let him update. WordPress uses a PHP function called version_compare to compare version ...


4

TimThumb has never been bundled with WordPress, it is/was entirely a third-party theme/plugin issue.



Only top voted, non community-wiki answers of a minimum length are eligible