84% phastpress

Code Review | PhastPress

WordPress plugin PhastPress scored84%from 54 tests.

About plugin

  • Plugin page: phastpress
  • Plugin version: 3.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Dec 28, 2017
  • Latest release: Dec 1, 2023
  • Number of updates: 345
  • Update frequency: every 6.3 days
  • Top authors: kiboit (100%)

Code review

54 tests

User reviews

98 reviews

Install metrics

10,000+ active /350,468 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.26MB] [CPU: ▲0.57ms] Passed 4 tests

A check of server-side resources used by PhastPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.73 ▲2.2735.19 ▼7.50
Dashboard /wp-admin5.75 ▲2.4156.75 ▼7.15
Posts /wp-admin/edit.php5.76 ▲2.4056.75 ▲11.06
Add New Post /wp-admin/post-new.php7.85 ▲1.96104.52 ▲5.87
Media Library /wp-admin/upload.php5.75 ▲2.5248.26 ▲13.58
PhastPress /wp-admin/options-general.php?page=phast-press6.05344.23

Server storage [IO: ▲1.02MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 4 files (232.83KB) illegally modified outside of "wp-content/plugins/phastpress/" and "wp-content/uploads/"
    • (new file) wp-content/cache/phast.6ff3d0158d1372de0be98fdeb5a143ee.1000/index.html
    • (new file) wp-content/cache/phast.6ff3d0158d1372de0be98fdeb5a143ee.1000/cache.sqlite3-journal
    • (new file) wp-content/cache/phast.6ff3d0158d1372de0be98fdeb5a143ee.1000/service-config-svtQ4ezAJzL0wGab
    • (new file) wp-content/cache/phast.6ff3d0158d1372de0be98fdeb5a143ee.1000/cache.sqlite3
Filesystem: 39 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
phastpress2-settings
phastpress_1.43
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for PhastPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲22914.61 ▲0.2634.79 ▲33.1541.77 ▼1.84
Dashboard /wp-admin2,223 ▲525.59 ▲0.0093.89 ▲2.8441.10 ▲1.72
Posts /wp-admin/edit.php2,132 ▲292.03 ▲0.0338.32 ▼2.5035.48 ▲0.54
Add New Post /wp-admin/post-new.php1,532 ▼223.05 ▼0.10653.43 ▲52.0554.03 ▼3.63
Media Library /wp-admin/upload.php1,429 ▲294.15 ▼0.0098.86 ▲3.5443.84 ▲1.51
PhastPress /wp-admin/options-general.php?page=phast-press1,3384.89141.1152.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • phastpress2-settings
    • can_compress_scripts
    • db_upgraded
    • phastpress_1.43
    • widget_recent-posts
    • widget_theysaidso_widget
    • 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 no errors were found, this is by no means 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 items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\Phast\\HTTP\\Client' not found in wp-content/plugins/phastpress/classes/RequestsHTTPClient.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Kibo\\PhastPlugins\\PhastPress\\ServiceSDKImplementation' not found in wp-content/plugins/phastpress/classes/PluginHostImplementation.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\PhastPlugins\\SDK\\Security\\PhastUser' not found in wp-content/plugins/phastpress/classes/PhastUserImplementation.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/phastpress/bootstrap.php:36
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\PhastPlugins\\SDK\\Caching\\CacheRootCandidatesProvider' not found in wp-content/plugins/phastpress/classes/CacheRootCandidatesProviderImplementation.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\PhastPlugins\\SDK\\ServiceHost' not found in wp-content/plugins/phastpress/classes/ServiceSDKImplementation.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\PhastPlugins\\SDK\\HostURLs' not found in wp-content/plugins/phastpress/classes/HostURLsImplementation.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\PhastPlugins\\SDK\\Configuration\\KeyValueStore' not found in wp-content/plugins/phastpress/classes/KeyValueStoreImplementation.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\PhastPlugins\\SDK\\Security\onceChecker' not found in wp-content/plugins/phastpress/classes/NonceCheckerImplementation.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Kibo\\PhastPlugins\\SDK\\AdminPanel\\InstallNoticeRenderer' not found in wp-content/plugins/phastpress/classes/InstallNoticeRendererImplementation.php:7

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can take inspiration from this readme.txt

phastpress/phastpress.php Passed 13 tests

"PhastPress" version 3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
99 characters long description:
PhastPress automatically optimizes your site for the best possible Google PageSpeed Insights score.

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
No dangerous file extensions were detected8,291 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP313762,5928,275
JavaScript22116

PHP code Passed 2 tests

This is a short overview 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.33
Average class complexity5.01
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces76
Interfaces23
Traits8
Classes195
▷ Abstract classes42.05%
▷ Concrete classes19197.95%
▷ Final classes00.00%
Methods850
▷ Static methods8910.47%
▷ Public methods60170.71%
▷ Protected methods556.47%
▷ Private methods19422.82%
Functions91
▷ Named functions1010.99%
▷ Anonymous functions8189.01%
Constants53
▷ Global constants59.43%
▷ Class constants4890.57%
▷ Public constants48100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo.png6.54KB3.69KB▼ 43.59%