Skip to content

Commit

Permalink
Initial Upload Added core functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
djm56 committed Nov 23, 2016
1 parent 80b5e37 commit b58721e
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,3 +16,4 @@ wp-content/plugins/hello.php
/sitemap.xml
/sitemap.xml.gz

/nbproject/private/
23 changes: 21 additions & 2 deletions README.md
@@ -1,2 +1,21 @@
# WPZA-Disable-Auto-Updates
WordPress plugin used by WPZA to disable automatic updates
# Disable Auto Updates
WordPress plugin used to disable all automatic updates to Core, Theme's or plugins.

*This plugin should only be used if your WordPress site is actively maintained.*

## Installation

### Via ZIP package

1. [Download ZIP package](https://wpza.co.za).
2. In your WP administration go to *Plugins* / *Add New* / *Upload plugin*.
3. Select the ZIP package you've downloaded in step 1.
4. Go to *Plugins* and enable Disable Auto Updates.

## Authors

* **Donovan Maidens** - *Initial work* - [WPZA](https://wpza.co.za)

## License

This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the [LICENSE.md](LICENSE.md) file for details
24 changes: 24 additions & 0 deletions includes/disable-auto-update.php
@@ -0,0 +1,24 @@
<?php

/*
* @link https://wpza.co.za
* @since 1.0.0
* @package wpza-disable-auto-update
*
* This disables all the updates for WordPress.
* This plugin should only be used on a WordPress site that is actively maintained.
*
*/


// Disable all Automatic Core Updates

add_filter( 'allow_dev_auto_core_updates', '__return_false' );
add_filter( 'allow_minor_auto_core_updates', '__return_false' );
add_filter( 'allow_major_auto_core_updates', '__return_false' );

// Disable All Automatic Plugin Updates
add_filter( 'auto_update_plugin', '__return_false' );

// Disable All Automatic Theme Updates
add_filter( 'auto_update_theme', '__return_false' );
2 changes: 2 additions & 0 deletions includes/index.php
@@ -0,0 +1,2 @@
<?php
// Silence is golden.
2 changes: 2 additions & 0 deletions index.php
@@ -0,0 +1,2 @@
<?php
// Silence is golden.
13 changes: 13 additions & 0 deletions uninstall.php
@@ -0,0 +1,13 @@
<?php

/**
*
* @link https://wpza.co.za
* @since 1.0.0
* @package wpza-maintenance
*/

// If uninstall not called from WordPress, then exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
56 changes: 56 additions & 0 deletions wpza-disable-auto-update.php
@@ -0,0 +1,56 @@
<?php

/**
*
* @link https://wpza.co.za
* @since 1.0.0
* @package wpza-disable-auto-update
*
* @wordpress-plugin
* Plugin Name: Disable Auto Updates
* Plugin URI: https://wpza.co.za/wpza-plugins
* Description: Disable all Core, Theme and Plugin Auto Updates.
* Version: 1.0.0
* Author: Donovan Maidens
* Author URI: https://wpza.co.za
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
if(!class_exists("WPZADisableUpdatePlugin"))
{

class WPZADisableUpdatePlugin
{

public function __construct()
{

require_once(sprintf("%s/includes/disable-auto-update.php", dirname(__FILE__)));

}


public static function activate()
{
// Do something
}


public static function deactivate()
{
// Do something
}
}
}

if(class_exists('WPZADisableUpdatePlugin'))
{
// Installation and uninstallation hooks
register_activation_hook(__FILE__, array('WPZADisableUpdatePlugin', 'activate'));
register_deactivation_hook(__FILE__, array('WPZADisableUpdatePlugin', 'deactivate'));


$plugin = new WPZADisableUpdatePlugin();
}

0 comments on commit b58721e

Please sign in to comment.