10% wpygments

Code Review | WPygments

WordPress plugin WPygments scored10%from 54 tests.

About plugin

  • Plugin page: wpygments
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8.1
  • WordPress version: 6.3.1
  • First release: May 5, 2013
  • Latest release: Mar 27, 2014
  • Number of updates: 13
  • Update frequency: every 25.4 days
  • Top authors: capynet (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,493 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/wpygments/wpygments.inc.php+138
    Function create_function() is deprecated

Server metrics [RAM: ▼1.88MB] [CPU: ▼56.03ms] Passed 4 tests

An overview of server-side resources used by WPygments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.354.97 ▼37.09
Dashboard /wp-admin2.14 ▼1.177.22 ▼48.26
Posts /wp-admin/edit.php2.14 ▼1.226.97 ▼46.88
Add New Post /wp-admin/post-new.php2.14 ▼3.756.09 ▼91.89
Media Library /wp-admin/upload.php2.14 ▼1.107.14 ▼34.72

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WPygments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.65 ▲0.291.86 ▼0.2942.01 ▼4.32
Dashboard /wp-admin2,195 ▲185.70 ▲0.0689.06 ▼12.5542.15 ▼2.89
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0137.38 ▲0.5834.05 ▲1.44
Add New Post /wp-admin/post-new.php1,531 ▲323.13 ▼0.05690.64 ▼14.6959.96 ▲8.81
Media Library /wp-admin/upload.php1,400 ▼34.23 ▲0.03113.30 ▼8.1247.61 ▼2.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wpygments/wpygments.inc.php+138
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
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/wpygments/wpygments.inc.php:138

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 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

wpygments/wpygments.inc.php 92% from 13 tests

The principal PHP file in "WPygments" v. 1.1.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wpygments.php" instead of "wpygments.inc.php")

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
Success! There were no dangerous files found in this plugin3,076 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
CSS2321202,398
Markdown2960321
PHP378128302
Python217933
JSON10022

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity7.33
▷ Minimum class complexity3.00
▷ Maximum class complexity13.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods969.23%
▷ Protected methods323.08%
▷ Private methods17.69%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
40 compressed PNG files occupy 0.48MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Documentation/img/style__0014_Layer-16.png12.01KB10.88KB▼ 9.44%
PHPygments/Documentation/img/style__0011_Layer-13.png13.38KB12.20KB▼ 8.84%
Documentation/img/style__0012_Layer-14.png12.55KB11.74KB▼ 6.44%
Documentation/img/style__0007_Layer-9.png12.39KB11.61KB▼ 6.31%
PHPygments/Documentation/img/style__0001_Layer-3.png12.32KB11.57KB▼ 6.07%