78% crayon-syntax-highlighter-to-pastacode

Code Review | Crayon Syntax Highlighter to Pastacode

WordPress plugin Crayon Syntax Highlighter to Pastacode scored78%from 54 tests.

About plugin

  • Plugin page: crayon-syntax-hig...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 6.3.1
  • First release: Aug 31, 2016
  • Latest release: Aug 31, 2016
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: willybahuaud (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,905 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼11.36ms] Passed 4 tests

Server-side resources used by Crayon Syntax Highlighter to Pastacode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0841.48 ▲1.02
Dashboard /wp-admin3.42 ▲0.0447.31 ▼20.00
Posts /wp-admin/edit.php3.47 ▲0.0847.73 ▲5.26
Add New Post /wp-admin/post-new.php6.02 ▲0.1086.29 ▼25.56
Media Library /wp-admin/upload.php3.34 ▲0.0834.54 ▼0.88
Migrate to Pastacode /wp-admin/tools.php?page=migrate_c2p3.2829.86

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: no files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Crayon Syntax Highlighter to Pastacode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.16 ▼1.404.39 ▲2.6542.23 ▼1.34
Dashboard /wp-admin2,207 ▲164.86 ▼0.02109.41 ▲2.9338.07 ▼3.25
Posts /wp-admin/edit.php2,090 ▲12.00 ▼0.0236.92 ▼5.1332.79 ▼5.41
Add New Post /wp-admin/post-new.php1,536 ▲823.10 ▲4.91674.03 ▲54.9953.34 ▲3.16
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.06101.42 ▲2.5241.95 ▼3.40
Migrate to Pastacode /wp-admin/tools.php?page=migrate_c2p7702.0625.5123.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/tools.php?page=migrate_c2p
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/tools.php?page=migrate_c2p
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/tools.php?page=migrate_c2p
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

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 items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Wabeo\\C2p\\add_action() in wp-content/plugins/crayon-syntax-highlighter-to-pastacode/crayon-to-pastacode.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: highlighter, migration, pastacode, crayon, syntax

crayon-syntax-highlighter-to-pastacode/crayon-to-pastacode.php 85% from 13 tests

"Crayon Syntax Highlighter to Pastacode" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("crayon-syntax-highlighter-to-pastacode.php" instead of "crayon-to-pastacode.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin321 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP25042240
PO File1141446
JavaScript15035

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin