84% phoenix-folding-at-home-stats

Code Review | Phoenix Folding@Home Stats

WordPress plugin Phoenix Folding@Home Stats scored84%from 54 tests.

About plugin

  • Plugin page: phoenix-folding-a...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 6.3.1
  • First release: Nov 30, 2016
  • Latest release: May 20, 2021
  • Number of updates: 10
  • Update frequency: every 163.2 days
  • Top authors: jamesjonesphoenix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /882 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼9.23ms] Passed 4 tests

This is a short check of server-side resources used by Phoenix Folding@Home Stats
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1638.18 ▲0.23
Dashboard /wp-admin3.47 ▲0.1642.80 ▼3.91
Posts /wp-admin/edit.php3.58 ▲0.2343.23 ▼8.03
Add New Post /wp-admin/post-new.php6.05 ▲0.1681.11 ▼25.21
Media Library /wp-admin/upload.php3.39 ▲0.1636.42 ▲3.48

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Phoenix Folding@Home Stats
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.61 ▼0.694.69 ▲3.0946.10 ▲8.01
Dashboard /wp-admin2,206 ▲184.87 ▼0.03120.08 ▲18.1045.37 ▲0.91
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0136.11 ▼5.8332.74 ▼1.51
Add New Post /wp-admin/post-new.php1,537 ▲1823.32 ▲0.27670.97 ▲98.0460.55 ▲11.56
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0395.93 ▲1.8843.34 ▲0.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_phoenix_folding_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'PhoenixFAH\\Stats' not found in wp-content/plugins/phoenix-folding-at-home-stats/src/StatsUser.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PhoenixFAH\\Stats' not found in wp-content/plugins/phoenix-folding-at-home-stats/src/StatsTeam.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/phoenix-folding-at-home-stats/src/Widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PhoenixFAH\\plugins_url() in wp-content/plugins/phoenix-folding-at-home-stats/src/FoldingHomeStats.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: folding, foldinghome, folding at home, table, stats...

phoenix-folding-at-home-stats/phoenix-folding-at-home-stats.php 92% from 13 tests

Analyzing the main PHP file in "Phoenix Folding@Home Stats" version 2.0.0
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,046 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP8128289860
Markdown137094
Sass112259
CSS22133

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity24.17
▷ Minimum class complexity3.00
▷ Maximum class complexity49.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods45
▷ Static methods12.22%
▷ Public methods4293.33%
▷ Protected methods00.00%
▷ Private methods36.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/fah-logo.png52.23KB13.95KB▼ 73.30%
assets/images/fah-arrows.png8.70KB3.77KB▼ 56.69%