84% lh-http2-server-push

Code Review | LH HTTP/2 Server Push

WordPress plugin LH HTTP/2 Server Push scored84%from 54 tests.

About plugin

  • Plugin page: lh-http2-server-push
  • Plugin version: 1.02
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: May 23, 2017
  • Latest release: May 25, 2017
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,466 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.01MB] [CPU: ▼8.80ms] Passed 4 tests

Server-side resources used by LH HTTP/2 Server Push
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.72 ▲0.34
Dashboard /wp-admin3.32 ▼0.0244.95 ▼11.55
Posts /wp-admin/edit.php3.38 ▲0.0248.17 ▲0.95
Add New Post /wp-admin/post-new.php5.90 ▲0.0279.23 ▼22.44
Media Library /wp-admin/upload.php3.25 ▲0.0232.33 ▼1.56

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for LH HTTP/2 Server Push
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.76 ▲0.451.75 ▲0.0445.99 ▲6.39
Dashboard /wp-admin2,209 ▲234.87 ▼0.1097.78 ▼9.8441.03 ▼0.15
Posts /wp-admin/edit.php2,089 ▲32.05 ▲0.0333.26 ▼1.9433.32 ▼1.27
Add New Post /wp-admin/post-new.php1,536 ▲1523.43 ▲0.28649.56 ▼28.2850.14 ▼17.28
Media Library /wp-admin/upload.php1,379 ▼124.21 ▼0.0899.73 ▼0.1643.30 ▼2.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

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 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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-http2-server-push/lh-http2-server-push.php:243

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: preload, prefetch, server push, http2, performance

lh-http2-server-push/lh-http2-server-push.php Passed 13 tests

The main PHP file in "LH HTTP/2 Server Push" ver. 1.02 adds more information about the plugin and also serves as the entry point for this plugin
86 characters long description:
HTTP/2 Server Push Optimization for JavaScript and CSS resources enqueued in the page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected99 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11133999

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods225.00%
▷ Protected methods00.00%
▷ Private methods675.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin