├── .htaccess
├── images
├── welaika.png
├── welaika.16x16.png
└── welaika.32x32.png
├── assets
├── icon-128x128.png
├── icon-256x256.png
└── banner-772x250.jpg
├── admin.php
├── footer.html.php
├── javascripts
└── constants.js
├── wordless-extender
├── WordlessCheck.php
├── WordlessExtenderDB.php
├── WordlessExtenderFilesystem.php
├── WordlessExtenderMenu.php
├── WordlessExtenderConstantCollection.php
├── WordlessExtenderWpconfig.php
├── WordlessExtender.php
├── WordlessExtenderConstantForm.php
├── WordlessExtenderSecurity.php
├── WordlessExtenderPluginManager.php
└── WordlessExtenderConstantManager.php
├── stylesheets
└── wordless-extender.css
├── wordless-extender.php
├── functions.php
├── constants.html.php
├── resources
├── wp-config.tpl
└── htaccess.tpl
├── README.md
├── deploy.sh
├── plugins.html.php
├── readme.txt
└── security.html.php
/.htaccess:
--------------------------------------------------------------------------------
1 | Options -Indexes
2 |
--------------------------------------------------------------------------------
/images/welaika.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/welaika/wordless-extender/HEAD/images/welaika.png
--------------------------------------------------------------------------------
/assets/icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/welaika/wordless-extender/HEAD/assets/icon-128x128.png
--------------------------------------------------------------------------------
/assets/icon-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/welaika/wordless-extender/HEAD/assets/icon-256x256.png
--------------------------------------------------------------------------------
/assets/banner-772x250.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/welaika/wordless-extender/HEAD/assets/banner-772x250.jpg
--------------------------------------------------------------------------------
/images/welaika.16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/welaika/wordless-extender/HEAD/images/welaika.16x16.png
--------------------------------------------------------------------------------
/images/welaika.32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/welaika/wordless-extender/HEAD/images/welaika.32x32.png
--------------------------------------------------------------------------------
/admin.php:
--------------------------------------------------------------------------------
1 |
2 | Wordless Extender is developed by weLaika.
3 | View README for more details.
4 | Report issues or suggestions here.
5 | Discover a better WordPress workflow visiting wordpress.welaika.com.
6 |
' . $message . '
'; 21 | } 22 | 23 | 24 | // Enqueue constants javascript 25 | function wle_constants_scripts(){ 26 | wp_register_script("wle_constants", WordlessExtender::$url ."/javascripts/constants.js", 'jquery', false, true); 27 | wp_enqueue_script("wle_constants"); 28 | } 29 | 30 | add_action('admin_enqueue_scripts', 'wle_constants_scripts' ); 31 | 32 | // Enqueue WLE stylesheets 33 | function wle_stylesheets(){ 34 | wp_register_style("wle_style", WordlessExtender::$url ."/stylesheets/wordless-extender.css"); 35 | wp_enqueue_style("wle_style"); 36 | } 37 | 38 | add_action('admin_enqueue_scripts', 'wle_stylesheets' ); 39 | -------------------------------------------------------------------------------- /wordless-extender/WordlessExtenderFilesystem.php: -------------------------------------------------------------------------------- 1 | 8 |
13 | wp-config.php has a lot of configurations that you want to remember.
14 | You can discover and manage them within this panel.
15 |
16 | At every update a wp-config.php.orig with previous version will be created.
17 | Remember to delete your cookies and don't worry about new login requests after keys updates.
18 |
19 | Use the power with care!
20 |
it_IT' );
21 | $list['EMPTY_TRASH_DAYS'] = array( 'type' => 'number', 'description' => 'Use an integer to set the maximum trashed contents retention in days' );
22 | $list['WP_POST_REVISIONS'] = array( 'type' => 'number', 'description' => 'Use an integer to set the maximum kept revisions per post' );
23 | $list['DISABLE_WP_CRON'] = array( 'type' => 'bool', 'description' => '' );
24 | $list['WP_ALLOW_REPAIR'] = array( 'type' => 'bool', 'description' => '' );
25 | $list['FS_METHOD'] = array( 'type' => 'text', 'description' => 'It forces the filesystem method. It should only be "direct", "ssh2", "ftpext", or "ftpsockets". For details view codex' );
26 |
27 | return $list;
28 | }
29 |
30 |
31 | // Generate custom array for key constant fields passing $key
32 | private static function salt_attributes($key){
33 | return array("tag" => "div", "text" => 'Generate Key', "attrs" => array("data-target" => $key, "class" => "button keygen_js"), "self_closing" => false );
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/resources/wp-config.tpl:
--------------------------------------------------------------------------------
1 | set_path();
12 | $this->set_content();
13 | $this->set_tpl();
14 | }
15 |
16 | private function set_path()
17 | {
18 | $this->path = ABSPATH . 'wp-config.php';
19 | }
20 |
21 | private function get_path()
22 | {
23 | return $this->path;
24 | }
25 |
26 | private function set_content()
27 | {
28 | $this->content = $this->read($this->get_path());
29 | }
30 |
31 | private function get_content()
32 | {
33 | return $this->content;
34 | }
35 |
36 | private function set_tpl()
37 | {
38 | $this->tpl = $this->read(WordlessExtender::$path . 'resources/wp-config.tpl');
39 | }
40 |
41 | public function get_tpl()
42 | {
43 | return $this->tpl;
44 | }
45 |
46 | public function read( $what = "" )
47 | {
48 | $file = empty($what) ? $this->path : $what;
49 |
50 | if (file_get_contents($file))
51 | return file_get_contents($file);
52 |
53 | wle_show_message('Impossible to read from ' . $file, true);
54 | return FALSE;
55 | }
56 |
57 | public function write( $what, $where = null )
58 | {
59 | $file = is_null($where) ? $this->path : $where;
60 |
61 | $retval = file_put_contents($file, $what);
62 |
63 | if ($retval === FALSE ){
64 | wle_show_message("Impossible to write in {$file}", true);
65 | return FALSE;
66 | }
67 | }
68 |
69 | public function search( $needle )
70 | {
71 | if (strstr($needle, 'WLE_')){
72 | $pattern = '/^#'.$needle.'(.*)#END_'.$needle.'$/ms';
73 | } else {
74 | $pattern = '/^#WLE_'.$needle.'(.*)#END_WLE'.$needle.'$/ms';
75 | }
76 | preg_match($pattern, $this->get_content(), $matches);
77 |
78 | return (!empty($matches)) ? $matches[0] : FALSE;
79 | }
80 |
81 | public function search_schema( $needle )
82 | {
83 | return strstr( addcslashes($this->get_content(), '$'), addcslashes($needle, '$') );
84 | }
85 |
86 | public function replace_constant( $name, $newvalue )
87 | {
88 | $pattern = "/^(#WLE_{$name}).*(#END_WLE_{$name})$/ms";
89 | $replacement = "$1\r\n";
90 | $replacement .= "$newvalue\r\n";
91 | $replacement .= "$2";
92 |
93 | $newdata = preg_replace($pattern, $replacement, $this->get_content(), 1, $count);
94 |
95 | if (is_null($newdata)){
96 | wle_show_message("Error updating {$name}", true);
97 | throw new Exception("The updated wp-config.php would be empty, so I'm giving up", 1);
98 | }
99 |
100 | return $newdata;
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/wordless-extender/WordlessExtender.php:
--------------------------------------------------------------------------------
1 | is_wordless_menu_present());
14 | add_action('admin_menu', array($wleMenu, 'create_menus'), 10);
15 |
16 | $this->set_site_url();
17 | $this->set_path($path);
18 | $this->set_dirname($path);
19 | $this->set_url();
20 | $this->set_to_be_installed_plugins();
21 | $this->set_admin_actions();
22 | $this->set_repository_url();
23 | }
24 |
25 | private function set_repository_url()
26 | {
27 | self::$repository_url = 'https://github.com/welaika/wordless-extender/';
28 | }
29 |
30 | private function set_site_url()
31 | {
32 | self::$site_url = get_bloginfo('url');
33 | }
34 |
35 | public function get_site_url()
36 | {
37 | return self::$site_url;
38 | }
39 |
40 | private function set_path($path)
41 | {
42 | self::$path = $path;
43 | }
44 |
45 | public function get_path()
46 | {
47 | return self::$path;
48 | }
49 |
50 | private function set_dirname($path)
51 | {
52 | self::$dirname = basename(self::$path);
53 | }
54 |
55 | public function get_dirname()
56 | {
57 | return self::$dirname;
58 | }
59 |
60 | private function set_url()
61 | {
62 | self::$url = plugins_url(self::$dirname);
63 | }
64 |
65 | public function get_url()
66 | {
67 | return self::$url;
68 | }
69 |
70 | private function set_admin_actions()
71 | {
72 | $constant_manager = WordlessExtenderConstantManager::get_instance();
73 | add_action('admin_action_update_constants', array( $constant_manager, 'update_constants' ) );
74 | add_action('admin_action_update_securities', array( 'WordlessExtenderSecurity', 'update_securities' ) );
75 |
76 | }
77 |
78 | private function set_to_be_installed_plugins()
79 | {
80 | $pluginlist = array(
81 | 'Wordless',
82 | 'Users to Csv',
83 | array('Name' => 'InfiniteWP - Client', 'Slug' => 'iwp-client'),
84 | 'Advanced Custom Fields',
85 | array('Name' => 'Advanced Custom Fields: Date and Time Picker', 'Slug' => 'acf-field-date-time-picker'),
86 | 'Debug Bar',
87 | 'Debug Bar Console',
88 | 'Debug Bar Extender',
89 | 'Formidable',
90 | 'Limit Login Attempts',
91 | 'Regenerate Thumbnails'
92 | );
93 | self::$to_be_installed_plugins = $pluginlist;
94 | }
95 |
96 | public static function get_message($code = 0)
97 | {
98 | $messages = array(0 => false, 1 => 'Successfully updated', 2 => 'Already done!');
99 | return $messages[$code];
100 | }
101 | }
102 |
103 |
--------------------------------------------------------------------------------
/resources/htaccess.tpl:
--------------------------------------------------------------------------------
1 | # BEGIN wordless-extender
2 |
3 |
17 | Community contribuited plugins are essential part of WP itself.
18 | We consider plugins as good ones if they are tested, are actively contribuited, are doing well a single task and have readable code.
19 |
20 |
21 | Here's a list of tested-by-weLaika® plugins with a control panel. 22 |
23 || Status | 43 |Name | 44 |Version | 45 |Options | 46 ||||||
|---|---|---|---|---|---|---|---|---|
| get_status(); ?> | 52 | 53 |get_data('Name'); ?> | 54 | 55 |56 | is_installed()) : ?> 57 | get_data('Version'); ?> 58 | 59 | | 60 | 61 |62 | is_installed()) : ?> 63 | Install 64 | 65 | | 66 | 67 |68 | is_installed()) : ?> 69 | Update 70 | 71 | | 72 | 73 |74 | is_installed() && !$p->is_active()) : ?> 75 | Activate 76 | 77 | | 78 | 79 |80 | is_active()) : ?> 81 | Deactivate 82 | 83 | | 84 | 85 |86 | is_installed() && !$p->is_active()) : ?> 87 | Delete 88 | 89 | | 90 | 91 |92 | Details 93 | | 94 |
12 | This is a collection of security tricks.
13 | These are taken from Hardening Wordpress and from our WP experience.
14 | Please, pay attention to the warnings.
15 |