84% magic-template-holder

Code Review | Magic Template Holder

WordPress plugin Magic Template Holder scored 84% from 54 tests.

About plugin

  • Plugin page: magic-template-ho...
  • Plugin version: 1.0.12
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Jan 25, 2016
  • Latest release: Dec 1, 2017
  • Number of updates: 14
  • Update frequency: every 48.5 days
  • Top authors: Nora0123456789 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 2,615 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.20ms] Passed 4 tests

Server-side resources used by Magic Template Holder
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0534.85 ▼5.05
Dashboard /wp-admin3.40 ▲0.0948.78 ▼5.96
Posts /wp-admin/edit.php3.51 ▲0.1547.63 ▲0.30
Add New Post /wp-admin/post-new.php6.02 ▲0.1393.61 ▲1.92
Media Library /wp-admin/upload.php3.32 ▲0.0938.65 ▲2.47
All MTH Templates /wp-admin/edit.php?post_type=mth-template3.3638.90
Group /wp-admin/edit-tags.php?taxonomy=mth-template-group&post_type=mth-template3.3130.62
Add new /wp-admin/post-new.php?post_type=mth-template3.4953.67
Settings /wp-admin/edit.php?post_type=mth-template&page=mth_template_options3.2929.38

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Magic Template Holder: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲13013.29 ▼1.374.12 ▲2.2739.75 ▼1.35
Dashboard /wp-admin2,246 ▲585.86 ▲0.98107.95 ▼9.7936.26 ▼12.87
Posts /wp-admin/edit.php2,129 ▲432.06 ▲0.0639.88 ▲5.9034.74 ▼1.71
Add New Post /wp-admin/post-new.php1,570 ▲3623.65 ▲0.58641.73 ▼10.1251.97 ▼9.28
Media Library /wp-admin/upload.php1,422 ▲314.30 ▲0.0297.86 ▼9.2344.77 ▲0.48
All MTH Templates /wp-admin/edit.php?post_type=mth-template1,1122.0034.8430.66
Group /wp-admin/edit-tags.php?taxonomy=mth-template-group&post_type=mth-template1,3022.1425.4726.12
Add new /wp-admin/post-new.php?post_type=mth-template2,3637.70174.4078.62
Settings /wp-admin/edit.php?post_type=mth-template&page=mth_template_options8012.0322.7520.75

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/magic-template-holder/templates/option-page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/magic-template-holder/templates/popup-forms.php:7

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 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === magic-template-holder === )
The official readme.txt is a good inspiration

magic-template-holder/magic-template-holder.php Passed 13 tests

"Magic Template Holder" version 1.0.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
49 characters long description:
Enable to handle templates easily on editor page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,060 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP5162124473
JavaScript3221290426
PO File14760108
CSS1161453

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.00
▷ Minimum class complexity8.00
▷ Maximum class complexity32.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
No PNG files were detected