83% page-optimize

Code Review | Page Optimize

WordPress plugin Page Optimize scored 83% from 54 tests.

About plugin

  • Plugin page: page-optimize
  • Plugin version: 0.5.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.8.2
  • WordPress version: 5.9.2
  • First release: Feb 27, 2020
  • Latest release: Dec 14, 2021
  • Number of updates: 18
  • Update frequency: every 36.8 days
  • Top authors: aidvu (61.11%)bpayton (44.44%)

Code review

54 tests

User reviews

1 review

Install metrics

100,000+ active / 9,678 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼290.22ms] Passed 4 tests

Server-side resources used by Page Optimize
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4359.18 ▼0.49
Dashboard /wp-admin3.63 ▲0.2235.50 ▲1.19
Posts /wp-admin/edit.php3.68 ▲0.0551.11 ▲10.37
Add New Post /wp-admin/post-new.php6.92 ▼0.05101.25 ▼1,160.79
Media Library /wp-admin/upload.php3.63 ▲0.3426.33 ▼0.77
Performance /wp-admin/options-general.php?page=page-optimize3.6127.63

Server storage [IO: ▲0.12MB] [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: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Page Optimize
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,779 ▲3510.44 ▼5.155.59 ▼0.6756.06 ▲53.85
Dashboard /wp-admin2,854 ▼16.11 ▼0.05117.04 ▼22.3357.09 ▼184.59
Posts /wp-admin/edit.php2,693 ▼13.25 ▲0.0191.06 ▲24.4342.50 ▼97.94
Add New Post /wp-admin/post-new.php1,708 ▲4718.03 ▲1.61390.78 ▼50.4379.04 ▼127.51
Media Library /wp-admin/upload.php1,685 ▼135.52 ▲0.08148.26 ▲6.3178.04 ▼119.78
Performance /wp-admin/options-general.php?page=page-optimize1,1172.6351.8043.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/page-optimize/tests/bootstrap.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/page-optimize/settings.php:105
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Styles' not found in wp-content/plugins/page-optimize/concat-css.php:10
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/page-optimize/page-optimize.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/page-optimize/tests/test_URL_to_file_mapping.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/page-optimize/page-optimize.php:63
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/page-optimize/page-optimize.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Scripts' not found in wp-content/plugins/page-optimize/concat-js.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=page-optimize
    • > Network (severe)
    _static/??-eJx1kcEOwiAQRH9Iio1E04PxWyisshGWBpb29yVNPLTJ3pi8GQZ29bYo6xOSdrVql1PKNHQ5dHnRB/jOJVWB7SeVgJpg8LaGOdviBR6xsmI7R5AqwCMLqMCKFTNJ0dSzVmAcIImdds5NKiW77h8+ZpFcbB7qbul6yUgMRbhjQ/8BltorMih04kLieCW5fG7M55GcX2cbB+UCuO/f9krP8W7MZKaHuf0AhynDfw== - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
1 plugin tags: performance

page-optimize/page-optimize.php Passed 13 tests

The main PHP script in "Page Optimize" version 0.5.2 is automatically included on every request by WordPress
68 characters long description:
Optimizes JS and CSS for faster page load and render in the browser.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,967 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP134366071,945
XML10015
JSON1007

PHP code Passed 2 tests

Analyzing 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.43
Average class complexity24.56
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods65
▷ Static methods1218.46%
▷ Public methods4061.54%
▷ Protected methods11.54%
▷ Private methods2436.92%
Functions45
▷ Named functions3986.67%
▷ Anonymous functions613.33%
Constants12
▷ Global constants650.00%
▷ Class constants650.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin