83% pgnviewerjs-wp

Code Review | PgnViewerJS

WordPress plugin PgnViewerJS scored83%from 54 tests.

About plugin

  • Plugin page: pgnviewerjs-wp
  • Plugin version: 1.5.13.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9
  • WordPress version: 6.3.1
  • First release: Dec 24, 2016
  • Latest release: Feb 7, 2022
  • Number of updates: 51
  • Update frequency: every 36.7 days
  • Top authors: mliebelt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /3,408 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.99ms] Passed 4 tests

An overview of server-side resources used by PgnViewerJS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.89 ▲2.93
Dashboard /wp-admin3.33 ▲0.0343.09 ▼1.51
Posts /wp-admin/edit.php3.38 ▲0.0343.81 ▲1.91
Add New Post /wp-admin/post-new.php5.91 ▲0.0378.56 ▼9.15
Media Library /wp-admin/upload.php3.26 ▲0.0336.86 ▲0.81

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for PgnViewerJS
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲6314.88 ▲0.5366.33 ▲64.4542.90 ▲3.88
Dashboard /wp-admin2,192 ▲115.51 ▼0.2182.51 ▼19.2137.18 ▼2.37
Posts /wp-admin/edit.php2,100 ▲32.01 ▲0.0236.19 ▲0.0233.38 ▲0.46
Add New Post /wp-admin/post-new.php1,526 ▼222.97 ▼0.19666.31 ▲32.9759.04 ▲2.11
Media Library /wp-admin/upload.php1,400 ▼04.10 ▼0.0398.15 ▼16.2343.46 ▼4.57

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

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
Good news, no errors were detected

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid URI found ("")
  • Plugin Name: Please specify the plugin name on the first line ( === pgnviewerjs-wp === )
The official readme.txt is a good inspiration

pgnviewerjs-wp/pgnviewerjs.php 92% from 13 tests

The primary PHP file in "PgnViewerJS" version 1.5.13.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pgnviewerjs-wp.php" instead of "pgnviewerjs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin145 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12315137
CSS1147
JavaScript1021

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin