Companion Auto Update - Version 2.0

Version Description

  • You can now select what to update and what not (plugins, themes, major and minor core updates)
Download this release

Release Info

Developer Papin
Plugin Icon 128x128 Companion Auto Update
Version 2.0
Comparing to
See all releases

Version 2.0

companion-auto-update.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Plugin Name: Companion Auto Update
4
+ * Plugin URI: https://qreative-web.com
5
+ * Description: This plugin auto updates all plugins, all themes and the wordpress core.
6
+ * Version: 2.0
7
+ * Author: Qreative-Web
8
+ * Author URI: https://qreative-web.com
9
+ * Contributors: papin
10
+ * License: GPLv2 or later
11
+ * License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
+ * Text Domain: companion-auto-update
13
+ * Domain Path: /languages/
14
+ */
15
+
16
+ // Disable direct access
17
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
18
+
19
+ function cau_load_translations() {
20
+
21
+ // Load translations
22
+ load_plugin_textdomain( 'companion-auto-update', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
23
+
24
+ }
25
+ add_action( 'init', 'cau_load_translations' );
26
+
27
+ // Install db
28
+ function cau_install() {
29
+
30
+ global $wpdb;
31
+ $table_name = $wpdb->prefix . "auto_updates";
32
+
33
+ $sql = "CREATE TABLE $table_name (
34
+ id INT(9) NOT NULL AUTO_INCREMENT,
35
+ description VARCHAR(255) NOT NULL,
36
+ name VARCHAR(255) NOT NULL,
37
+ onoroff VARCHAR(3) NOT NULL,
38
+ UNIQUE KEY id (id)
39
+ ) $charset_collate;";
40
+
41
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
42
+ dbDelta( $sql );
43
+
44
+ add_option( "cau_db_version", "1.0" );
45
+
46
+ cau_install_data();
47
+ }
48
+
49
+ // Inset Data
50
+ function cau_install_data() {
51
+
52
+ global $wpdb;
53
+ $table_name = $wpdb->prefix . "auto_updates";
54
+
55
+ $wpdb->insert(
56
+ $table_name,
57
+ array(
58
+ 'description' => 'Auto update plugins?',
59
+ 'name' => 'plugins',
60
+ 'onoroff' => 'on',
61
+ )
62
+ );
63
+
64
+ $wpdb->insert(
65
+ $table_name,
66
+ array(
67
+ 'description' => 'Auto update themes?',
68
+ 'name' => 'themes',
69
+ 'onoroff' => 'on',
70
+ )
71
+ );
72
+
73
+ $wpdb->insert(
74
+ $table_name,
75
+ array(
76
+ 'description' => 'Auto update minor core updates?',
77
+ 'name' => 'minor',
78
+ 'onoroff' => 'on',
79
+ )
80
+ );
81
+
82
+ $wpdb->insert(
83
+ $table_name,
84
+ array(
85
+ 'description' => 'Auto update major core updates?',
86
+ 'name' => 'major',
87
+ 'onoroff' => 'on',
88
+ )
89
+ );
90
+
91
+ }
92
+ register_activation_hook( __FILE__, 'cau_install' );
93
+
94
+ // Add plugin to menu
95
+ function register_cau_menu_page() {
96
+ add_submenu_page( 'tools.php', __('Auto Updater', 'companion-auto-update'), __('Auto Updater', 'companion-auto-update'), 'manage_options', 'cau-settings', 'cau_frontend' );
97
+ }
98
+ add_action( 'admin_menu', 'register_cau_menu_page' );
99
+
100
+ // Settings page
101
+ function cau_frontend() { ?>
102
+
103
+ <div class='wrap'>
104
+
105
+ <h1><?php _e('Auto Updater', 'companion-auto-update');?></h1>
106
+
107
+ <?php
108
+
109
+
110
+ if( isset( $_POST['submit'] ) ) {
111
+
112
+ global $wpdb;
113
+ $table_name = $wpdb->prefix . "auto_updates";
114
+
115
+ $plugins = $_POST['plugins'];
116
+ $themes = $_POST['themes'];
117
+ $minor = $_POST['minor'];
118
+ $major = $_POST['major'];
119
+
120
+ $wpdb->query( " UPDATE $table_name SET onoroff = '$plugins' WHERE name = 'plugins' " );
121
+ $wpdb->query( " UPDATE $table_name SET onoroff = '$themes' WHERE name = 'themes' " );
122
+ $wpdb->query( " UPDATE $table_name SET onoroff = '$minor' WHERE name = 'minor' " );
123
+ $wpdb->query( " UPDATE $table_name SET onoroff = '$major' WHERE name = 'major' " );
124
+
125
+ echo '<div id="message" class="updated"><p>'.__('Settings saved', 'companion-auto-update').'</p></div>';
126
+ }
127
+
128
+ ?>
129
+
130
+ <form method="POST">
131
+
132
+ <?php
133
+
134
+ global $wpdb;
135
+ $table_name = $wpdb->prefix . "auto_updates";
136
+
137
+ $cau_configs = $wpdb->get_results( "SELECT * FROM $table_name" );
138
+
139
+ foreach ( $cau_configs as $config ) {
140
+
141
+ echo '<p><input id="'.$config->name.'" name="'.$config->name.'" type="checkbox"';
142
+ if( $config->onoroff == 'on' ) {
143
+ echo 'checked';
144
+ }
145
+ echo '/> <label for="'.$config->name.'">'.__(''.$config->description.'', 'companion-auto-update').'</label></p>';
146
+
147
+ }
148
+
149
+ submit_button(); ?>
150
+
151
+ </form>
152
+
153
+ </div>
154
+
155
+ <?php }
156
+
157
+ // Auto Update Class
158
+ class CAU_auto_update {
159
+
160
+ public function __construct() {
161
+
162
+ // Enable Update filters
163
+ add_action( 'plugins_loaded', array( &$this, 'CAU_auto_update_filters' ), 1 );
164
+
165
+ }
166
+
167
+ public function CAU_auto_update_filters() {
168
+
169
+
170
+ global $wpdb;
171
+ $table_name = $wpdb->prefix . "auto_updates";
172
+
173
+ // Enable for major updates
174
+ $configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'major'");
175
+ foreach ( $configs as $config ) {
176
+
177
+ if( $config->onoroff == 'on' ) add_filter( 'allow_major_auto_core_updates', '__return_true', 1 );
178
+
179
+ }
180
+
181
+ // Enable for minor updates
182
+ $configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'minor'");
183
+ foreach ( $configs as $config ) {
184
+
185
+ if( $config->onoroff == 'on' ) add_filter( 'allow_minor_auto_core_updates', '__return_true', 1 );
186
+
187
+ }
188
+
189
+ // Enable for plugins
190
+ $configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'plugins'");
191
+ foreach ( $configs as $config ) {
192
+
193
+ if( $config->onoroff == 'on' ) add_filter( 'auto_update_plugin', '__return_true', 1 );
194
+
195
+ }
196
+
197
+ // Enable for themes
198
+ $configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'themes'");
199
+ foreach ( $configs as $config ) {
200
+
201
+ if( $config->onoroff == 'on' ) add_filter( 'auto_update_theme', '__return_true', 1 );
202
+
203
+ }
204
+
205
+ }
206
+
207
+ }
208
+
209
+ new CAU_auto_update();
210
+
211
+ ?>
languages/companion-auto-update-nl.mo ADDED
Binary file
languages/companion-auto-update-nl.pot ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 Companion Auto Update
2
+ # This file is distributed under the same license as the Companion Auto Update package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Companion Auto Update 1.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/companion-auto-"
7
+ "update\n"
8
+ "POT-Creation-Date: 2016-05-24 10:17+0200\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2016-05-24 10:18+0200\n"
13
+ "Language-Team: \n"
14
+ "X-Generator: Poedit 1.8.7\n"
15
+ "Last-Translator: \n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "Language: nl\n"
18
+
19
+ #. Plugin Name of the plugin/theme
20
+ msgid "Companion Auto Update"
21
+ msgstr ""
22
+
23
+ #. Plugin URI of the plugin/theme
24
+ #. Author URI of the plugin/theme
25
+ msgid "https://qreative-web.com"
26
+ msgstr ""
27
+
28
+ #. Description of the plugin/theme
29
+ msgid ""
30
+ "This plugin auto updates all plugins, all themes and the wordpress core."
31
+ msgstr "Deze plugin update alle plugins, themas en de wordpress core."
32
+
33
+ #. Author of the plugin/theme
34
+ msgid "Qreative-Web"
35
+ msgstr ""
languages/companion-auto-update-nl_NL.mo ADDED
Binary file
languages/companion-auto-update-nl_NL.pot ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 Companion Auto Update
2
+ # This file is distributed under the same license as the Companion Auto Update package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Companion Auto Update 1.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/companion-auto-"
7
+ "update\n"
8
+ "POT-Creation-Date: 2016-05-24 10:17+0200\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2016-05-24 10:18+0200\n"
13
+ "Language-Team: \n"
14
+ "X-Generator: Poedit 1.8.7\n"
15
+ "Last-Translator: \n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "Language: nl\n"
18
+
19
+ #. Plugin Name of the plugin/theme
20
+ msgid "Companion Auto Update"
21
+ msgstr ""
22
+
23
+ #. Plugin URI of the plugin/theme
24
+ #. Author URI of the plugin/theme
25
+ msgid "https://qreative-web.com"
26
+ msgstr ""
27
+
28
+ #. Description of the plugin/theme
29
+ msgid ""
30
+ "This plugin auto updates all plugins, all themes and the wordpress core."
31
+ msgstr "Deze plugin update alle plugins, themas en de wordpress core."
32
+
33
+ #. Author of the plugin/theme
34
+ msgid "Qreative-Web"
35
+ msgstr ""
languages/companion-auto-update-nl_NL_formal.mo ADDED
Binary file
languages/companion-auto-update-nl_NL_formal.pot ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 Companion Auto Update
2
+ # This file is distributed under the same license as the Companion Auto Update package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Companion Auto Update 1.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/companion-auto-"
7
+ "update\n"
8
+ "POT-Creation-Date: 2016-05-24 10:17+0200\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2016-05-24 10:18+0200\n"
13
+ "Language-Team: \n"
14
+ "X-Generator: Poedit 1.8.7\n"
15
+ "Last-Translator: \n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "Language: nl\n"
18
+
19
+ #. Plugin Name of the plugin/theme
20
+ msgid "Companion Auto Update"
21
+ msgstr ""
22
+
23
+ #. Plugin URI of the plugin/theme
24
+ #. Author URI of the plugin/theme
25
+ msgid "https://qreative-web.com"
26
+ msgstr ""
27
+
28
+ #. Description of the plugin/theme
29
+ msgid ""
30
+ "This plugin auto updates all plugins, all themes and the wordpress core."
31
+ msgstr "Deze plugin update alle plugins, themas en de wordpress core."
32
+
33
+ #. Author of the plugin/theme
34
+ msgid "Qreative-Web"
35
+ msgstr ""
languages/companion-auto-update.pot ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 Companion Auto Update
2
+ # This file is distributed under the same license as the Companion Auto Update package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Companion Auto Update 1.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/companion-auto-"
7
+ "update\n"
8
+ "POT-Creation-Date: 2016-05-24 08:16:37+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+
16
+ #: companion_portfolio.php:96
17
+ msgid "Auto Updater"
18
+ msgstr ""
19
+
20
+ #: companion_portfolio.php:122
21
+ msgid "Auto update plugins?"
22
+ msgstr ""
23
+
24
+ #: companion_portfolio.php:122
25
+ msgid "Auto update themes?"
26
+ msgstr ""
27
+
28
+ #: companion_portfolio.php:122
29
+ msgid "Auto update minor core updates?"
30
+ msgstr ""
31
+
32
+ #: companion_portfolio.php:122
33
+ msgid "Auto update major core updates?"
34
+ msgstr ""
35
+
36
+ #: companion_portfolio.php:125
37
+ msgid "Settings saved"
38
+ msgstr ""
39
+
40
+ #. Plugin Name of the plugin/theme
41
+ msgid "Companion Auto Update"
42
+ msgstr ""
43
+
44
+ #. #-#-#-#-# plugin.pot (Companion Auto Update 1.0) #-#-#-#-#
45
+ #. Plugin URI of the plugin/theme
46
+ #. #-#-#-#-# plugin.pot (Companion Auto Update 1.0) #-#-#-#-#
47
+ #. Author URI of the plugin/theme
48
+ msgid "https://qreative-web.com"
49
+ msgstr ""
50
+
51
+ #. Description of the plugin/theme
52
+ msgid ""
53
+ "This plugin auto updates all plugins, all themes and the wordpress core."
54
+ msgstr ""
55
+
56
+ #. Author of the plugin/theme
57
+ msgid "Qreative-Web"
58
+ msgstr ""
readme.txt ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Companion Auto Update ===
2
+ Contributors: Papin
3
+ Donate link: https://www.paypal.me/dakel/1
4
+ Tags: auto, automatic, background, update, updates, automatic updates, automatic background updates, easy update, wordpress update, theme update, plugin update, up-to-date, security, update latest version, update core, update wp, update wp core, major updates, minor updates, update to new version, update core, update plugin, update plugins, update plugins automatically, update theme
5
+ Requires at least: 3.5.0
6
+ Tested up to: 4.5
7
+ Stable tag: 2.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ This plugin automatically updates all plugins, all themes and the wordpress core in the background.
12
+
13
+ == Description ==
14
+
15
+ = Keep your website safe! =
16
+ This plugin automatically updates all plugins, all themes and the wordpress core (both major and minor updates), you can configure whether you want to update everything (default) or only some.
17
+
18
+ == Installation ==
19
+
20
+ 1. Download Companion Auto Update.
21
+ 1. Upload the 'Companion Auto Update' directory to your '/wp-content/plugins/' directory.
22
+ 1. Activate Companion Auto Update from your Plugins page.
23
+
24
+ == Screenshots ==
25
+
26
+ 1. Configure what to update and what not
27
+
28
+ == Changelog ==
29
+
30
+ = 2.0 =
31
+ * You can now select what to update and what not (plugins, themes, major and minor core updates)
32
+
33
+ = 1.0 =
34
+ * Initital release