Tag Info

Hot answers tagged

22

Looks like the applicable code is in wp-includes/update.php, wp_update_plugins(): $to_send = (object) compact('plugins', 'active'); $options = array( 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3), 'body' => array( 'plugins' => serialize( $to_send ) ), 'user-agent' => 'WordPress/' . $wp_version . '; ' . ...


19

For example if you don't want Wordpress to show update notifications for akismet, you will do it like: function filter_plugin_updates( $value ) { unset( $value->response['akismet/akismet.php'] ); return $value; } add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );


18

While you can't modify it without changing it, you can isolate the parts you change by creating a Child Theme. In summary: Create a theme directory on peer with your "parent" theme, Create a style.css file in your new directory that has a Template: declaration in the comments naming your parent theme and an @import url(../%parent-theme%/style.css) to ...


17

This plugin does it for you: Automatic Updates For Private And Commercial Plugins Since time immemorial, only plugins hosted in the official WordPress.org plugin directory have supported automatic updates. Now, I’ve written a PHP library that you can use to add automatic update capabilities to any plugin. Public, private and commercial plugins alike ...


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 ...


13

If you edit your wp-config.php file you can preload these FTP settings as constants read by WordPress. Keep in mind, on a shared host, you should be mindful of possible security implications. See Editing wp-config.php for more information. Your settings will vary, but these work for me and my hosting setup. I've included some of the unused constants, ...


10

Check your file ownership. When the user that apache runs as can write to the wordpress directories, then the integrated upgrade process all just works without ftp. The FTP credentials are for if the web server doesn't have the right priviledges on your files, then wordpress prompts you for your FTP details, and attempts to use those to FTP back to the same ...


9

Do not just upgrade immediately. Take the time you need for an informed decision. And make a backup, of course. :) Read the changelog for the new version. Example for 3.4.1. The blog announcements and the Codex pages are not complete. Test the upgrade with an exact copy of your production site, including plugins and themes. Add, change and delete an ...


9

Essentially, WordPress needs to connect back to the server where it is actually running on. There are several possible ways WordPress can use to write files and thus "overwrite" itself during an upgrade. From a security perspective, the important part of this process is that the new files must have the same ownership as the old files. So, WordPress ...


9

I for myself use a combination of: one file dedicated to the one-time script using a transient to stop the script from accidentally running more than once using capability-management or user-control to ensure the script is just run by me. Structure I use a file (onetime.php) in my include-folder inc, which is included in the functions.php, and deleted ...


8

Maruti Mohanty’s suggestion is not bad, but it will fail. There are many core actions with a higher priority: wp-admin/menu.php: add_action('admin_menu', '_add_themes_utility_last', 101); wp-includes/admin-bar.php: add_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); wp-includes/canonical.php add_action( 'template_redirect', ...


8

When you update a plugin you just get a new Zip-file containing the whole plugin. You don't get the information which files in that archive changed. That's the reason why all files are overwritten.


8

http://codex.wordpress.org/Function_Reference/register_post_type example: //add filter to ensure the text Book, or book, is displayed when user updates a book add_filter('post_updated_messages', 'codex_book_updated_messages'); function codex_book_updated_messages( $messages ) { global $post, $post_ID; $messages['book'] = array( 0 => '', // ...


8

I'm embarrassed to say that I am a bit clueless on the procedure used to update a plugin via tortoise svn even though my plugin has been on the repository for years and had over 300,000 downloads! Don't be. SVN can be tricky for a lot of people ... so let's go through things step-by-step ... This is what I've been doing so far. code the ...


8

This message is created by W3_Total_Cache->in_plugin_update_message() hooked to "in_plugin_update_message-$file"in wp_plugin_update_row(). It does some nifties to parse readme and display info from changelog, but overall you can just echo some stuff as with any other hook.


8

you got the first part right about using personal_options_update but to be on the safe side add edit_user_profile_update also. and as for sending emails within WordPress the best way would be to use wp_mail, So something like this: add_action( 'personal_options_update', 'notify_admin_on_update' ); add_action( ...


7

I'm looking into the same thing. A couple of links that I've found that might be helpful: WordPress.org Plugin Information API Docs get_api_data() on Pastebin The first is some info and pointers to the upgrades API. The second is a code snippet showing how to actually request info from the API.


7

Hook building To make the action hook name clear: global $pagenow; if ( 'plugins.php' === $pagenow ) { // Better update message $file = basename( __FILE__ ); $folder = basename( dirname( __FILE__ ) ); $hook = "in_plugin_update_message-{$folder}/{$file}"; add_action( $hook, 'your_update_message_cb', 20, 2 ); } Hooked callback ...


7

Updating this answer the original code below will remove the nag screen but it will ping the server for updates on every load, thanks to @ El Yobo, see update below. This will disable the core updates and the nag screen to everyone but superadmins. add_action( 'after_setup_theme', 'remove_core_updates' ); function remove_core_updates() { if ( ! ...


7

Less than an answer, but just a list of things straight from my experience with it - maybe you've overlooked something. Debugging the request & its results Without diggin' too deep into the update process, but the WP HTTP API uses the WP_HTTP class. It also offers a nice thing: A debug hook. do_action( 'http_api_debug', $response, 'response', $class, ...


6

Generally speaking WordPress will update the .htaccess file any time you change the permalink structure. Many plugins will also update/modify the file as needed. But the default structure of the .htaccess file allows you to lay it out in such a way that WordPress will not overwrite your custom entries. WordPress will overwrite the entries between '# BEGIN ...


6

How to hide WordPress update mesages CSS The low-tech way to hide something is using css: // Low-tech hiding of update-mesages // source: http://wpsnipp.com/index.php/functions-php/hide-update-nag-within-the-admin/ function remove_upgrade_nag() { echo '<style type="text/css"> .update-nag {display: none} </style>'; } ...


6

Yep Its possible if you hook a function to site_transient_update_plugins filter hook and check if plugin is activated using is_plugin_active like this: add_filter('site_transient_update_plugins', 'remove_update_nag_for_deactivated'); function remove_update_nag_for_deactivated($value) { foreach($value->response as $key => $val){ if ...


6

I use XAMPP myself, but WAMP isn't much different. I'll bet you have not enabled the curl module. WordPress can use other methods (streams and fsockopen) as a fallback, but these may be disabled by default as well in a stock install. Curl is preferred and easy to enable. Close WAMP Go your the \bin\php\version directory in WAMP Edit the php.ini, and ...


6

You can also do this: run onetime.php and rename it after execution. if ( current_user_can( 'manage_options' ) ) { if( ! file_exists( '/path/to/onetime.php' ) ) return; add_action( 'wp_footer', 'ravs_my_onetime_function' ); // execute my function on the desired hook. } function ravs_my_onetime_function() { // all my glorious ...


6

When submitting a plugin, the slug becomes the sanitized plugin name, as submitted. The "Name" of the plugin can change after this, but the slug remains the same forever more. When WordPress needs to check for a plugin update, it gets all the header information of the plugin and the directory name that the plugin is in, and sends that to WordPress.org. ...


6

gear-solid: Looking in the Source Code... Here's the function from WP-DBManager Plugin that generates that error: function dbmanager_admin_notices() { $backup_options = get_option('dbmanager_options'); if(!@file_exists($backup_options['path'].'/.htaccess')) { echo '<div class="error" style="text-align: center;"><p style="color: red; ...


5

Howdy! I think your question is really of use as it represents a very valid and clear scenario. The scope of your question is important: disabled write access to the database. I'm fine with disabling comments from now on. The second point is not that important for my answer, as you could understand user content as "your" content probably. As long as ...


5

You can also hook into the core update routine. (I'm looking for tutorial links, but my Google-fu is failing me this morning.) EDIT: See if this tutorial helps. It explains how to implement automatic upgrades for private/commercial (i.e. non-repository-hosted) Plugins.


5

you can use pre_post_update action hook like so: add_action('pre_post_update','post_updating_callback'); function post_updating_callback($post_id){ global $post; // verify if this is an auto save routine. // If it is our form has not been submitted, so we dont want to do anything if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ...



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