78% aph-prism-highlighter

Code Review | APH Prism Syntax Highlighter

WordPress plugin APH Prism Syntax Highlighter scored78%from 54 tests.

About plugin

  • Plugin page: aph-prism-highlig...
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.1
  • WordPress version: 6.3.1
  • First release: Aug 12, 2016
  • Latest release: Feb 14, 2023
  • Number of updates: 88
  • Update frequency: every 27.0 days
  • Top authors: agusph (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /5,293 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.63MB] [CPU: ▼1.55ms] Passed 4 tests

This is a short check of server-side resources used by APH Prism Syntax Highlighter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.46 ▼1.09
Dashboard /wp-admin4.11 ▲0.8150.38 ▼2.09
Posts /wp-admin/edit.php4.23 ▲0.8753.05 ▲4.34
Add New Post /wp-admin/post-new.php6.72 ▲0.8390.11 ▼7.35
Media Library /wp-admin/upload.php4.04 ▲0.8139.32 ▲7.50
Prism Highlighter /wp-admin/options-general.php?page=aph-prism-highlighter3.9834.16

Server storage [IO: ▲1.87MB] [DB: ▲0.04MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 773 new files
Database: no new tables, 10 new options
New WordPress options
aphph_phdata
aphph_notice
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
aphph_plugin_version
aphph_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for APH Prism Syntax Highlighter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲1214.26 ▼0.481.79 ▼0.3442.55 ▼8.86
Dashboard /wp-admin2,207 ▲305.68 ▲0.0386.59 ▼13.2841.02 ▼4.87
Posts /wp-admin/edit.php2,112 ▲92.02 ▼0.0334.80 ▼0.4033.55 ▼5.08
Add New Post /wp-admin/post-new.php1,861 ▲33023.42 ▲0.34595.06 ▼62.6335.66 ▼14.99
Media Library /wp-admin/upload.php1,409 ▲64.21 ▼0.0098.46 ▼2.1640.97 ▼5.38
Prism Highlighter /wp-admin/options-general.php?page=aph-prism-highlighter2,7141.8027.0233.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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=aph-prism-highlighter
    • > Notice in wp-content/plugins/aph-prism-highlighter/includes/aphph-admin.php+512
    Undefined index: options

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
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/aph-prism-highlighter/includes/aphph-config.php on line 13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/aph-prism-highlighter/includes/aphph-config.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/aph-prism-highlighter/aph-prism-highlighter.php:12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/aph-prism-highlighter/includes/aphph-config.php on line 12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/aph-prism-highlighter/includes/aphph-config.php on line 13

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: syntax, syntax highlighter, highlighter, prism

aph-prism-highlighter/aph-prism-highlighter.php 92% from 13 tests

This is the main PHP file of "APH Prism Syntax Highlighter" version 1.5.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 246 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin29,668 lines of code in 763 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6562,1833,51321,064
CSS502491582,495
HTML28691432,380
JSON2001,896
PHP143162591,748
SVG130085

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity26.89
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods67
▷ Static methods00.00%
▷ Public methods6394.03%
▷ Protected methods00.00%
▷ Private methods45.97%
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

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
js/img/aphph-button.png0.47KB0.51KB0.00%