10% wp-source-control

Code Review | WP Source Control

WordPress plugin WP Source Control scored10%from 54 tests.

About plugin

  • Plugin page: wp-source-control
  • Plugin version: 3.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Oct 13, 2012
  • Latest release: Oct 28, 2014
  • Number of updates: 27
  • Update frequency: every 27.6 days
  • Top authors: MMDeveloper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,281 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wp-source-control/source_control_path.php+45
    Function create_function() is deprecated

Server metrics [RAM: ▼0.43MB] [CPU: ▼16.13ms] Passed 4 tests

Server-side resources used by WP Source Control
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2643.86 ▲3.74
Dashboard /wp-admin3.57 ▲0.2248.08 ▼13.67
Posts /wp-admin/edit.php3.68 ▲0.3247.56 ▲2.56
Add New Post /wp-admin/post-new.php3.41 ▼2.4738.27 ▼53.99
Media Library /wp-admin/upload.php3.49 ▲0.2635.45 ▲0.58
WP Source Control /wp-admin/admin.php?page=wp-source-control/source_control_list.php3.4928.86
Backup / Restore /wp-admin/admin.php?page=wp-source-control/source_control_backup.php3.5532.57
Search Commit /wp-admin/admin.php?page=wp-source-control/source_control_search.php3.5131.60
Clean Up /wp-admin/admin.php?page=wp-source-control/source_control_clean_up.php3.4733.25

Server storage [IO: ▲0.14MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • The plugin illegally modified 2 files (9.29KB) outside of "wp-content/plugins/wp-source-control/" and "wp-content/uploads/"
    • (new file) wp-content/downloadfiles/download.php
    • (new file) wp-content/downloadfiles/source_control_zip.php
Filesystem: 26 new files
Database: 3 new tables, 8 new options
New tables
wp_version_controls
wp_version_control_posts
wp_version_control_templates
New WordPress options
widget_recent-posts
source_control_version
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
recovery_mode_email_last_sent
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WP Source Control
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.19 ▼1.491.67 ▼0.1744.74 ▲1.92
Dashboard /wp-admin2,237 ▲494.83 ▼1.04101.90 ▼14.5940.97 ▼8.82
Posts /wp-admin/edit.php2,120 ▲282.01 ▼0.0433.19 ▼3.7433.28 ▼0.11
Add New Post /wp-admin/post-new.php1,558 ▲2522.78 ▼0.44601.27 ▼73.4054.21 ▲2.06
Media Library /wp-admin/upload.php1,419 ▲314.20 ▼0.0097.03 ▼1.4841.45 ▼5.76
WP Source Control /wp-admin/admin.php?page=wp-source-control/source_control_list.php4,6102.0637.2179.74
Backup / Restore /wp-admin/admin.php?page=wp-source-control/source_control_backup.php7341.148.2532.21
Search Commit /wp-admin/admin.php?page=wp-source-control/source_control_search.php9052.0030.8527.36
Clean Up /wp-admin/admin.php?page=wp-source-control/source_control_clean_up.php6881.536.3715.55

Uninstaller [IO: ▲0.01MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_version_control_templates
    • wp_version_controls
    • wp_version_control_posts
  • Zombie WordPress options detected upon uninstall: 8 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • source_control_version
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_search.php+231
    Undefined index: submit
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_search.php+72
    Undefined index: vc_action
  • 1063 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_backup.php
    • > Deprecated in wp-content/plugins/wp-source-control/source_control_path.php+45
    Function create_function() is deprecated
  • 117 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_list.php
    • > Notice in wp-content/plugins/wp-source-control/wp-content_source_control.php+289
    Undefined variable: content
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_list.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_list.php+164
    Undefined index: job_no
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_list.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_list.php+173
    Undefined index: description
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Deprecated in wp-content/plugins/wp-source-control/source_control_search.php+240
    Non-static method SCTomM8::add_social_share_links() should not be called statically
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_backup.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_backup.php+23
    Undefined index: restore
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_backup.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_backup.php+31
    Undefined index: delete
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_backup.php
    • > Error in wp-content/plugins/wp-source-control/source_control_backup.php+201
    Uncaught Error: Call to undefined function split() in wp-content/plugins/wp-source-control/source_control_backup.php:201
    Stack trace:
    #0 wp-admin/admin.php(293): include()
    #1 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_search.php+127
    Undefined index: search_job_no
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_search.php+135
    Undefined index: search_start_date
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_search.php+143
    Undefined index: search_end_date
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_clean_up.php
    • > Notice in wp-content/plugins/wp-source-control/source_control_clean_up.php+19
    Trying to get property 'id' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-source-control/source_control_template_log.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/wp-source-control/source_control_list.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/wp-source-control/source_control_clean_up.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/wp-source-control/source_control_search.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-source-control/wp-content_source_control.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/wp-source-control/source_control_backup.php:3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-source-control/source_control_search.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-source-control/source_control_list.php on line 23
    • > PHP Notice
      Undefined index: path in wp-content/plugins/wp-source-control/downloadfiles/download.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_list.php
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'top')" "TypeError: Cannot read properties of undefined (reading 'top')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-source-control/admin_source_control.js?ver=6.3.1:9:43)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_list.php
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'top')
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Network (severe)
    wp-content/plugins/wp-source-control/css/jquery-ui.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wp-source-control/source_control_search.php
    • > Network (severe)
    wp-content/plugins/wp-source-control/css/images/calendar.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: source, pages, templates, posts, control...

wp-source-control/wp-content_source_control.php 92% from 13 tests

The main PHP script in "WP Source Control" version 3.1.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-source-control.php" instead of "wp-content_source_control.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected2,276 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP164093102,266
JavaScript12010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity72.33
▷ Minimum class complexity2.00
▷ Maximum class complexity207.00
Average method complexity5.12
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods52
▷ Static methods47.69%
▷ Public methods5198.08%
▷ Protected methods00.00%
▷ Private methods11.92%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/rate-me.png2.62KB1.53KB▼ 41.67%
images/edit.png1.69KB0.59KB▼ 65.22%
images/trash.png1.52KB0.70KB▼ 53.85%