84% rest-api-support-for-crayon-syntax-highlighter

Code Review | REST API support for Crayon Syntax Highlighter

WordPress plugin REST API support for Crayon Syntax Highlighter scored 84% from 54 tests.

About plugin

  • Plugin page: rest-api-support-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 12, 2018
  • Latest release: Nov 12, 2018
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: miunosoft (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 1,875 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.07ms] Passed 4 tests

A check of server-side resources used by REST API support for Crayon Syntax Highlighter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.37 ▼3.57
Dashboard /wp-admin3.32 ▲0.0156.64 ▲3.75
Posts /wp-admin/edit.php3.38 ▲0.0158.37 ▲4.45
Add New Post /wp-admin/post-new.php5.91 ▲0.0195.11 ▼30.29
Media Library /wp-admin/upload.php3.25 ▲0.0135.82 ▼2.17

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

REST API support for Crayon Syntax Highlighter: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.61 ▲0.401.69 ▼0.4142.79 ▼4.51
Dashboard /wp-admin2,200 ▼65.84 ▼0.05101.94 ▼7.8142.62 ▼0.82
Posts /wp-admin/edit.php2,092 ▲62.00 ▲0.0341.58 ▲4.8837.17 ▲1.41
Add New Post /wp-admin/post-new.php1,533 ▲1923.36 ▲5.74788.24 ▲158.6958.56 ▲11.51
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0597.87 ▼10.0143.38 ▲2.04

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rest-api-support-for-crayon-syntax-highlighter/rest-api-support-for-crayon-syntax-highlighter.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: rest, syntax highlight, code, crayon, syntax highlighter...

rest-api-support-for-crayon-syntax-highlighter/rest-api-support-for-crayon-syntax-highlighter.php Passed 13 tests

The principal PHP file in "REST API support for Crayon Syntax Highlighter" v. 1.0.0 is loaded by WordPress automatically on each request
62 characters long description:
Adds WordPress REST API support for Crayon Syntax Highlighter.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin81 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2145681

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity9.00
▷ Minimum class complexity5.00
▷ Maximum class complexity13.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods9
▷ Static methods444.44%
▷ Public methods444.44%
▷ Protected methods00.00%
▷ Private methods555.56%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin