84% inserter

Code Review | Inserter

WordPress plugin Inserter scored84%from 54 tests.

About plugin

  • Plugin page: inserter
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-4.9
  • WordPress version: 6.3.1
  • First release: Feb 11, 2018
  • Latest release: Feb 17, 2018
  • Number of updates: 4
  • Update frequency: every 1.5 days
  • Top authors: aristath (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,397 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.46ms] Passed 4 tests

A check of server-side resources used by Inserter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.29 ▼5.04
Dashboard /wp-admin3.33 ▲0.0342.21 ▼4.15
Posts /wp-admin/edit.php3.38 ▲0.0347.21 ▼1.93
Add New Post /wp-admin/post-new.php5.95 ▲0.0680.22 ▼22.70
Media Library /wp-admin/upload.php3.25 ▲0.0335.90 ▲4.81
Templates /wp-admin/edit.php?post_type=inserter_template3.3134.64
Add New /wp-admin/post-new.php?post_type=inserter_template3.3042.73

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Inserter: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲19014.67 ▲0.1119.92 ▲18.1740.41 ▼6.38
Dashboard /wp-admin2,230 ▲394.84 ▼0.10114.39 ▲12.1743.28 ▲1.50
Posts /wp-admin/edit.php2,110 ▲212.02 ▼0.0441.28 ▼3.7034.45 ▼1.62
Add New Post /wp-admin/post-new.php1,546 ▲224.56 ▲6.24702.52 ▲88.6862.12 ▲13.98
Media Library /wp-admin/upload.php1,412 ▲244.16 ▼0.0297.62 ▼3.6543.12 ▼0.13
Templates /wp-admin/edit.php?post_type=inserter_template1,0903.3786.1731.98
Add New /wp-admin/post-new.php?post_type=inserter_template1,8614.49102.3155.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=inserter_template
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'value')" "TypeError: Cannot read properties of undefined (reading 'value')\n at Function.fg [as fromTextArea] (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1:30:31506)\n at d.codeEditor.initialize (/wp-admin/js/code-editor.min.js?ver=6.3.1:2:1977)\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit.php?post_type=inserter_template:48:36)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&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,wp-codemirror,underscore&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=inserter_template
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'value')" "TypeError: Cannot read properties of undefined (reading 'value')\n at Function.fg [as fromTextArea] (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1:30:31506)\n at d.codeEditor.initialize (/wp-admin/js/code-editor.min.js?ver=6.3.1:2:1977)\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit.php?post_type=inserter_template:50:36)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&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,wp-codemirror,underscore&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=inserter_template
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1 29:31505 Uncaught TypeError: Cannot read properties of undefined (reading 'value')

Optimizations

Plugin configuration Passed 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
4 plugin tags: templates, rest api, rest, underscorejs

inserter/inserter.php Passed 13 tests

The primary PHP file in "Inserter" version 1.1 is used by WordPress to initiate all plugin functionality
67 characters long description:
Create custom underscore.js templates and inject them in your pages

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin426 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP379275331
JavaScript2204495

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity25.00
▷ Minimum class complexity16.00
▷ Maximum class complexity34.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1894.74%
▷ Protected methods15.26%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin