84% rpb-chessboard

Code Review | RPB Chessboard

WordPress plugin RPB Chessboard scored84%from 54 tests.

About plugin

  • Plugin page: rpb-chessboard
  • Plugin version: 7.7.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3-6.4
  • WordPress version: 6.3.1
  • First release: Oct 31, 2013
  • Latest release: Nov 11, 2023
  • Number of updates: 347
  • Update frequency: every 10.6 days
  • Top authors: yo35 (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

1,000+ active /78,815 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.37MB] [CPU: ▲5.34ms] Passed 4 tests

An overview of server-side resources used by RPB Chessboard
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3547.65 ▲8.68
Dashboard /wp-admin3.67 ▲0.3652.66 ▲2.68
Posts /wp-admin/edit.php3.73 ▲0.3854.29 ▲7.31
Add New Post /wp-admin/post-new.php6.27 ▲0.38101.94 ▲2.68
Media Library /wp-admin/upload.php3.60 ▲0.3749.29 ▲14.64
RPB Chessboard /wp-admin/options-general.php?page=rpbchessboard3.6444.46

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

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

Browser metrics Passed 4 tests

Checking browser requirements for RPB Chessboard
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲22220.89 ▲6.555.27 ▲3.5737.54 ▼6.38
Dashboard /wp-admin2,295 ▲11510.34 ▲4.68261.40 ▲159.1347.79 ▲0.58
Posts /wp-admin/edit.php2,195 ▲9510.38 ▲8.4394.85 ▲56.6137.12 ▲3.92
Add New Post /wp-admin/post-new.php6,382 ▲4,85629.11 ▲6.05775.86 ▲123.5138.86 ▼17.25
Media Library /wp-admin/upload.php1,518 ▲11512.94 ▲8.82142.93 ▲43.7841.72 ▼0.55
RPB Chessboard /wp-admin/options-general.php?page=rpbchessboard1,3759.72108.9541.45

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 92× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/rpb-chessboard/php/templates/adminpage/chessgamesettings/navigationtoolbar.php:23
    • > PHP Warning
      Use of undefined constant RPBCHESSBOARD_ABSPATH - assumed 'RPBCHESSBOARD_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rpb-chessboard/php/controllerfrontend.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/rpb-chessboard/php/templates/adminpage/chessdiagramsettings/alignment.php:23
    • > PHP Warning
      Use of undefined constant RPBCHESSBOARD_ABSPATH - assumed 'RPBCHESSBOARD_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rpb-chessboard/php/controlleradmin.php on line 23
    • > PHP Warning
      Use of undefined constant RPBCHESSBOARD_ABSPATH - assumed 'RPBCHESSBOARD_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rpb-chessboard/php/models/adminsubpage/compatibilitysettings.php on line 23
    • > PHP Warning
      require_once(RPBCHESSBOARD_ABSPATHphp/models/block/abstract.php): failed to open stream: No such file or directory in wp-content/plugins/rpb-chessboard/php/models/block/shortcodepgn.php on line 23
    • > PHP Warning
      Use of undefined constant RPBCHESSBOARD_ABSPATH - assumed 'RPBCHESSBOARD_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rpb-chessboard/php/models/adminsubpage/abstractform.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/rpb-chessboard/php/templates/adminpage/generic/form.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/rpb-chessboard/php/templates/adminpage/theming/piecesets.php:23
    • > PHP Fatal error
      require_once(): Failed opening required 'RPBCHESSBOARD_ABSPATHphp/models/adminsubpage/abstractform.php' (include_path='.:/usr/share/php') in wp-content/plugins/rpb-chessboard/php/models/adminsubpage/chessgamesettings.php on line 23

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 Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: games, pgn, chessboard, fen, chess

rpb-chessboard/rpb-chessboard.php Passed 13 tests

The entry point to "RPB Chessboard" version 7.7.1 is a PHP file that has certain tags in its header comment area
89 characters long description:
This plugin allows you to typeset and display chess diagrams and PGN-encoded chess games.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin11,599 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
PO File112,5522,9946,965
PHP661,0622,1293,801
CSS512278832
JavaScript1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.70
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits5
Classes32
▷ Abstract classes825.00%
▷ Concrete classes2475.00%
▷ Final classes00.00%
Methods257
▷ Static methods5421.01%
▷ Public methods15761.09%
▷ Protected methods4617.90%
▷ Private methods5421.01%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
135 PNG files occupy 0.48MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
third-party-libs/jquery/images/ui-icons_cd0a0a_256x240.png4.51KB4.18KB▼ 7.28%
build/images/cburnett-bb.ea6f2416.png1.66KB1.65KB▼ 0.59%
images/undefined-wb.png2.20KB1.88KB▼ 14.63%
build/images/celtic-bb.e9ae0c1c.png5.35KB2.99KB▼ 44.19%
build/images/eyes-wn.91dfea2b.png4.84KB2.62KB▼ 45.91%