10% quant

Code Review | QuantCDN

WordPress plugin QuantCDN scored10%from 54 tests.

About plugin

  • Plugin page: quant
  • Plugin version: 1.5.1
  • PHP compatiblity: 8.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 1, 2020
  • Latest release: Nov 10, 2023
  • Number of updates: 35
  • Update frequency: every 32.4 days
  • Top authors: stooit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,752 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/quant/src/Client.php+26
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.48MB] [CPU: ▲2.55ms] 75% from 4 tests

A check of server-side resources used by QuantCDN
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 557.52ms on /wp-admin/options-general.php?page=quant)
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4644.42 ▲1.44
Dashboard /wp-admin3.79 ▲0.4851.46 ▲4.63
Posts /wp-admin/edit.php3.84 ▲0.4846.67 ▲6.13
Add New Post /wp-admin/post-new.php6.37 ▲0.4895.23 ▲1.16
Media Library /wp-admin/upload.php3.71 ▲0.4838.58 ▲2.98
QuantCDN /wp-admin/options-general.php?page=quant3.69557.52

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 42 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
wp_quant_seed
wp_quant_settings
db_upgraded
quant_internal_token
can_compress_scripts
theysaidso_admin_options
wp_quant_cron_settings
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for QuantCDN
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲2314.41 ▲0.031.78 ▼0.3042.71 ▼1.60
Dashboard /wp-admin2,212 ▲475.54 ▼0.1593.61 ▼7.7736.94 ▼8.26
Posts /wp-admin/edit.php2,120 ▲171.94 ▼0.0836.77 ▼3.9432.95 ▼3.38
Add New Post /wp-admin/post-new.php1,551 ▲2525.05 ▲1.88626.02 ▼50.4775.40 ▲16.44
Media Library /wp-admin/upload.php1,417 ▲174.18 ▼0.06101.05 ▼19.2444.22 ▼2.85
QuantCDN /wp-admin/options-general.php?page=quant8782.1622.7928.09

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 22× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/quant/src/seed/MediaAssetsBatch.php
    • > /wp-content/plugins/quant/wp-batch-processing/includes/class-batch-ajax-handler.php
    • > /wp-content/plugins/quant/src/seed/PostBatch.php
    • > /wp-content/plugins/quant/wp-batch-processing/examples/class-example-batch.php
    • > /wp-content/plugins/quant/wp-batch-processing/includes/class-bp-singleton.php
    • > /wp-content/plugins/quant/src/seed/PageBatch.php
    • > /wp-content/plugins/quant/src/seed/CustomCronRoutesBatch.php
    • > /wp-content/plugins/quant/src/seed/CategoryBatch.php
    • > /wp-content/plugins/quant/wp-batch-processing/includes/class-batch.php
    • > /wp-content/plugins/quant/src/seed/TagBatch.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/quant/templates/quant-validate.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Quant_WP_Batch_Processor' not found in wp-content/plugins/quant/wp-batch-processing/views/batch-manage.php:23
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/quant/wp-batch-processing/views/batch-manage.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/quant/wp-batch-processing/views/batch-list.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/quant/quant-cli.php:248
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Quant\\plugin_dir_path() in wp-content/plugins/quant/src/App.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/quant/src/functions.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Quant_WP_BP_Helper' not found in wp-content/plugins/quant/wp-batch-processing/views/batch-view.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Quant\\get_option() in wp-content/plugins/quant/src/Client.php:23
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/quant/src/functions.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: cdn, jamstack, quant, static site generator, static

quant/quant.php Passed 13 tests

The main PHP script in "QuantCDN" version 1.5.1 is automatically included on every request by WordPress
32 characters long description:
QuantCDN static edge integration

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,595 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP377541,3922,390
Markdown1390121
JavaScript111084

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.89
▷ Minimum class complexity2.00
▷ Maximum class complexity49.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits1
Classes27
▷ Abstract classes13.70%
▷ Concrete classes2696.30%
▷ Final classes13.85%
Methods128
▷ Static methods1511.72%
▷ Public methods11388.28%
▷ Protected methods97.03%
▷ Private methods64.69%
Functions26
▷ Named functions2596.15%
▷ Anonymous functions13.85%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin