78% aph-syntax-highlighter

Code Review | APH Syntax Highlighter

WordPress plugin APH Syntax Highlighter scored78%from 54 tests.

About plugin

  • Plugin page: aph-syntax-highli...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Aug 21, 2016
  • Latest release: Apr 22, 2017
  • Number of updates: 27
  • Update frequency: every 9.4 days
  • Top authors: agusph (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,878 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.35MB] [CPU: ▼16.72ms] Passed 4 tests

A check of server-side resources used by APH Syntax Highlighter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.68 ▼37.24
Dashboard /wp-admin3.44 ▲0.1455.16 ▼0.30
Posts /wp-admin/edit.php3.55 ▲0.2051.82 ▼1.57
Add New Post /wp-admin/post-new.php5.58 ▼0.3076.65 ▼27.77
Media Library /wp-admin/upload.php3.36 ▲0.1439.53 ▲1.89
Syntax Highlighter /wp-admin/options-general.php?page=aph-syntax-highlighter3.3130.90

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 45 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
aphsh_shdata
widget_recent-posts
theysaidso_admin_options
aphsh_options
db_upgraded
aphsh_notice
widget_recent-comments
aphsh_plugin_version

Browser metrics Passed 4 tests

A check of browser resources used by APH Syntax Highlighter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6513.59 ▼0.781.53 ▼0.2842.20 ▼1.27
Dashboard /wp-admin2,217 ▲294.89 ▼1.11111.43 ▲9.6339.06 ▼1.07
Posts /wp-admin/edit.php2,100 ▲112.02 ▼0.0041.31 ▲1.2436.34 ▼1.17
Add New Post /wp-admin/post-new.php1,532 ▼423.16 ▼0.14626.86 ▼30.5455.25 ▼6.55
Media Library /wp-admin/upload.php1,399 ▲84.23 ▲0.04102.81 ▼3.7941.95 ▼4.29
Syntax Highlighter /wp-admin/options-general.php?page=aph-syntax-highlighter1,2241.8526.9331.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • 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
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=aph-syntax-highlighter
    • > Deprecated in wp-content/plugins/aph-syntax-highlighter/includes/aphsh-admin.php+463
    join(): Passing glue string after array is deprecated. Swap the parameters
    • > GET request to /wp-admin/options-general.php?page=aph-syntax-highlighter
    • > Notice in wp-content/plugins/aph-syntax-highlighter/includes/aphsh-admin.php+512
    Undefined index: options

SRP 50% 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
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > 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-syntax-highlighter/includes/aphsh-config.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/aph-syntax-highlighter/aph-syntax-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-syntax-highlighter/includes/aphsh-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-syntax-highlighter/includes/aphsh-config.php on line 13
    • > 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-syntax-highlighter/includes/aphsh-config.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 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
3 plugin tags: syntax highlighter, syntax, highlighter

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

The primary PHP file in "APH Syntax Highlighter" version 1.2.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 249 characters long)

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 detected14,228 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript132,7025,31210,295
CSS1447202,866
PHP8127101959
JSON10096
SVG10012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity17.00
▷ Minimum class complexity7.00
▷ Maximum class complexity33.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods3892.68%
▷ Protected methods00.00%
▷ Private methods37.32%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
js/img/aphsh-button.png0.82KB0.66KB▼ 19.81%