83% smartass-highlighter

Code Review | SmartAss Highlighter

WordPress plugin SmartAss Highlighter scored83%from 54 tests.

About plugin

  • Plugin page: smartass-highlighter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.2.2
  • WordPress version: 6.3.1
  • First release: Jan 15, 2015
  • Latest release: May 9, 2015
  • Number of updates: 5
  • Update frequency: every 23.0 days
  • Top authors: th3pirat3 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,685 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.02MB] [CPU: ▼4.24ms] Passed 4 tests

An overview of server-side resources used by SmartAss Highlighter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.50 ▼4.02
Dashboard /wp-admin3.33 ▲0.0346.95 ▼4.18
Posts /wp-admin/edit.php3.38 ▲0.0245.12 ▲3.10
Add New Post /wp-admin/post-new.php5.91 ▲0.0278.96 ▼11.86
Media Library /wp-admin/upload.php3.25 ▲0.0238.01 ▲4.02
SmartAss Highlighter /wp-admin/options-general.php?page=smartass-highlighter/SmartAss-Highlighter-admin.php3.2229.52

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for SmartAss Highlighter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8814.79 ▲0.121.90 ▲0.0743.72 ▼0.57
Dashboard /wp-admin2,215 ▲275.83 ▲0.96112.17 ▼2.3242.14 ▼2.70
Posts /wp-admin/edit.php2,097 ▲82.03 ▼0.0134.19 ▼1.3735.56 ▲1.95
Add New Post /wp-admin/post-new.php1,540 ▼323.31 ▲5.11646.73 ▲17.3853.31 ▼10.27
Media Library /wp-admin/upload.php1,399 ▲114.21 ▼0.0193.70 ▼10.6140.88 ▼2.37
SmartAss Highlighter /wp-admin/options-general.php?page=smartass-highlighter/SmartAss-Highlighter-admin.php8562.0324.0937.86

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/smartass-highlighter/SmartAss-Highlighter.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smartass-highlighter/SmartAss-Highlighter-admin.php:50

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Visual editor screenshot), #2 (Text only editor screenshot), #3 (Sample highlighted output with line numbers), #4 (Sample highlighted output without line numbers), #5 (Code button)
  • Tags: There are too many tags (26 tag instead of maximum 10)
You can take inspiration from this readme.txt

smartass-highlighter/SmartAss-Highlighter.php 85% from 13 tests

The principal PHP file in "SmartAss Highlighter" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("smartass-highlighter.php" instead of "SmartAss-Highlighter.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 351 characters long)

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
There were no executable files found in this plugin212 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP21728134
CSS10054
JavaScript21424

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
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
Namespaces0
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png5.80KB3.88KB▼ 33.09%
screenshot-1.png8.97KB5.12KB▼ 42.94%
screenshot-3.png6.64KB4.33KB▼ 34.81%
highlighter.png0.64KB0.83KB0.00%
screenshot.png10.66KB5.52KB▼ 48.22%