83% theme-editor

Code Review | Theme Editor

WordPress plugin Theme Editor scored83%from 54 tests.

About plugin

  • Plugin page: theme-editor
  • Plugin version: 2.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Dec 1, 2023
  • Number of updates: 42
  • Update frequency: every 57.6 days
  • Top authors: mndpsingh287 (100%)

Code review

54 tests

User reviews

113 reviews

Install metrics

50,000+ active /525,275 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼0.92ms] Passed 4 tests

Analyzing server-side resources used by Theme Editor
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.71 ▲0.01
Dashboard /wp-admin3.84 ▲0.5450.67 ▼2.43
Posts /wp-admin/edit.php3.90 ▲0.5452.08 ▲4.20
Add New Post /wp-admin/post-new.php6.36 ▲0.4893.02 ▼5.45
Media Library /wp-admin/upload.php3.71 ▲0.4838.28 ▲7.47
Theme Code Editor /wp-admin/admin.php?page=theme_editor_theme4.3344.12
Child Theme Permission /wp-admin/admin.php?page=ms_child_theme_editor_control3.6734.10
Notify Me /wp-admin/admin.php?page=theme_editor_notify3.6734.47
Child Theme /wp-admin/admin.php?page=ms_child_theme_editor4.5843.96
Plugin Code Editor /wp-admin/plugins.php?page=theme_editor_plugin3.8736.64
Plugin Code Editor /wp-admin/admin.php?page=theme_editor_plugin3.7739.46
Access Control /wp-admin/admin.php?page=theme_editor_permisions3.6733.24
Theme Code Editor /wp-admin/themes.php?page=theme_editor_theme4.4742.90
Settings /wp-admin/admin.php?page=theme_editor_settings3.7135.32

Server storage [IO: ▲2.77MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 201 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
mk_te_settings_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Theme Editor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲10614.23 ▼0.451.70 ▼0.2737.54 ▼6.62
Dashboard /wp-admin2,246 ▲695.61 ▲0.0696.03 ▼8.4370.19 ▲21.99
Posts /wp-admin/edit.php2,169 ▲692.00 ▲0.0239.58 ▲0.3234.04 ▼2.67
Add New Post /wp-admin/post-new.php1,743 ▲21724.63 ▲1.48667.90 ▲3.2348.45 ▼5.12
Media Library /wp-admin/upload.php1,460 ▲664.17 ▼0.0196.94 ▲0.0373.90 ▲29.33
Theme Code Editor /wp-admin/admin.php?page=theme_editor_theme2,2433.5480.21169.09
Child Theme Permission /wp-admin/admin.php?page=ms_child_theme_editor_control8782.0023.9531.06
Notify Me /wp-admin/admin.php?page=theme_editor_notify8732.0026.1229.88
Child Theme /wp-admin/admin.php?page=ms_child_theme_editor1,4522.3955.3340.66
Plugin Code Editor /wp-admin/plugins.php?page=theme_editor_plugin2,2942.4462.9554.64
Plugin Code Editor /wp-admin/admin.php?page=theme_editor_plugin2,2912.4565.4679.62
Access Control /wp-admin/admin.php?page=theme_editor_permisions8702.0122.7228.59
Theme Code Editor /wp-admin/themes.php?page=theme_editor_theme2,2433.3778.97134.65
Settings /wp-admin/admin.php?page=theme_editor_settings1,3202.0035.4332.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • mk_te_settings_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/theme-editor/ms_child_theme_editor.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/theme-editor/theme_editor.php:12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/theme-editor/theme_editor.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
  • Screenshots: Please add images for these screenshots: #14 (Preview Theme), #15 (Child Theme Permission)
The official readme.txt might help

theme-editor/theme_editor.php 92% from 13 tests

The main PHP file in "Theme Editor" ver. 2.8 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("theme-editor.php" instead of "theme_editor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin31,262 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript682,2331,67519,045
PHP297766507,778
CSS614782763,994
PO File3177186435
SVG10010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity84.77
▷ Minimum class complexity1.00
▷ Maximum class complexity419.00
Average method complexity5.46
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods244
▷ Static methods187.38%
▷ Public methods23596.31%
▷ Protected methods00.00%
▷ Private methods93.69%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants1292.31%
▷ Class constants17.69%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
24 PNG files occupy 0.55MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
app/view/images/mseditor-notify-icon.png1.39KB0.73KB▼ 47.57%
app/view/images/folder.png1.72KB1.18KB▼ 31.53%
app/view/images/html.png1.67KB1.02KB▼ 38.69%
includes/assests/image/download.png1.11KB0.19KB▼ 82.61%
app/view/images/php.png1.81KB1.01KB▼ 44.05%