79% sir-trevor-wp

Code Review | Sir Trevor WP

WordPress plugin Sir Trevor WP scored79%from 54 tests.

About plugin

  • Plugin page: sir-trevor-wp
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 16, 2014
  • Latest release: Jan 9, 2015
  • Number of updates: 11
  • Update frequency: every 32.6 days
  • Top authors: nkyre (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,755 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.24MB] [CPU: ▼21.13ms] Passed 4 tests

Analyzing server-side resources used by Sir Trevor WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.99 ▲0.4938.05 ▼3.79
Dashboard /wp-admin3.37 ▼0.0250.94 ▼14.79
Posts /wp-admin/edit.php3.42 ▲0.0243.85 ▼10.09
Add New Post /wp-admin/post-new.php4.95 ▼0.9846.84 ▼55.85
Media Library /wp-admin/upload.php3.29 ▲0.0233.14 ▼1.65

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Sir Trevor WP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.301.64 ▼0.1443.77 ▲4.73
Dashboard /wp-admin2,198 ▲275.65 ▲0.0691.03 ▲0.1840.56 ▼4.16
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0536.14 ▼1.0535.06 ▼0.31
Add New Post /wp-admin/post-new.php6,085 ▲4,55717.55 ▼5.68792.76 ▲155.5161.04 ▲10.84
Media Library /wp-admin/upload.php1,400 ▲34.22 ▼0.0096.51 ▼4.2942.33 ▼5.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sir-trevor-wp/block-templates/code.php
    • > /wp-content/plugins/sir-trevor-wp/block-templates/image.php
    • > /wp-content/plugins/sir-trevor-wp/block-templates/heading.php
  • 22× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: block in wp-content/plugins/sir-trevor-wp/block-templates/video.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sir-trevor-wp/block-templates/code.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Michelf\\Markdown' not found in wp-content/plugins/sir-trevor-wp/block-templates/text.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sir-trevor-wp/sir-trevor-wp.php:23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sir-trevor-wp/block-templates/video.php on line 2
    • > PHP Notice
      Undefined variable: block in wp-content/plugins/sir-trevor-wp/block-templates/image.php on line 18
    • > PHP Notice
      Undefined variable: block in wp-content/plugins/sir-trevor-wp/block-templates/code.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sir-trevor-wp/block-templates/heading.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sir-trevor-wp/block-templates/code.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sir-trevor-wp/block-templates/image.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
1 plugin tags: editor

sir-trevor-wp/sir-trevor-wp.php Passed 13 tests

The primary PHP file in "Sir Trevor WP" version 1.1.1 is used by WordPress to initiate all plugin functionality
55 characters long description:
An intuitive, block-based content editor for Wordpress.

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 detected4,989 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript67872812,462
PHP94478182,066
CSS38110461

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity55.33
▷ Minimum class complexity1.00
▷ Maximum class complexity102.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes2
▷ Abstract classes150.00%
▷ Concrete classes150.00%
▷ Final classes00.00%
Methods97
▷ Static methods22.06%
▷ Public methods66.19%
▷ Protected methods9193.81%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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