78% wp-optimize-by-xtraffic

Code Review | WP Optimize By xTraffic

WordPress plugin WP Optimize By xTraffic scored78%from 54 tests.

About plugin

  • Plugin page: wp-optimize-by-xt...
  • Plugin version: 5.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.4
  • WordPress version: 6.3.1
  • First release: Jul 29, 2014
  • Latest release: Jan 22, 2016
  • Number of updates: 48
  • Update frequency: every 11.3 days
  • Top authors: pep.vn (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

300+ active /161,269 total downloads

Benchmarks

Plugin footprint 82% 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.26MB] [CPU: ▼12.72ms] Passed 4 tests

Server-side resources used by WP Optimize By xTraffic
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2538.94 ▼3.64
Dashboard /wp-admin3.58 ▲0.2448.22 ▼18.31
Posts /wp-admin/edit.php3.62 ▲0.2645.76 ▼6.33
Add New Post /wp-admin/post-new.php6.28 ▲0.3979.06 ▼22.61
Media Library /wp-admin/upload.php3.52 ▲0.2937.53 ▲2.43

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

Input-output and database impact of this plugin
Please fix the following
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/wp-optimize-by-xtraffic/" and "wp-content/uploads/"
    • (new file) wp-content/pep-vn/static-vars/.empty
Filesystem: 467 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

WP Optimize By xTraffic: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲11014.78 ▲0.772.04 ▲0.2045.65 ▲1.55
Dashboard /wp-admin2,237 ▲375.87 ▼0.03106.01 ▼7.9845.51 ▲1.07
Posts /wp-admin/edit.php2,116 ▲162.05 ▲0.0236.28 ▲0.6936.98 ▲2.03
Add New Post /wp-admin/post-new.php1,541 ▲722.68 ▼0.55666.76 ▲19.6555.24 ▲6.32
Media Library /wp-admin/upload.php1,416 ▲164.20 ▼0.06100.35 ▼8.3050.00 ▲1.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Frontend/views/error/404.php
    • > /wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Backend/views/error/404.php
    • > /wp-content/plugins/wp-optimize-by-xtraffic/includes/composer/vendor/crodas/languagedetector/example/learn.php
    • > /wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Frontend/views/index/index.php
    • > /wp-content/plugins/wp-optimize-by-xtraffic/includes/composer/vendor/crodas/languagedetector/example/classify.php
    • > /wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Backend/views/layouts/partials/sponsors/vertical_socials.php
    • > /wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Backend/views/dashboard/index.php
  • 161× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WpPepVN\\Validation\\Validator' not found in wp-content/plugins/wp-optimize-by-xtraffic/libs/WpPepVN/Validation/Validator/Identical.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'WpPepVN\\Validation\\Validator' not found in wp-content/plugins/wp-optimize-by-xtraffic/libs/WpPepVN/Validation/Validator/Numericality.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WpPepVN\\Form\\Form' not found in wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Backend/Form/OptimizeImagesOptionsForm.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WpPepVN\\Form\\Form' not found in wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Backend/Form/OptimizeLinksOptionsForm.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WPOptimizeByxTraffic\\Application\\Service\\ControllerBase' not found in wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Backend/Controller/ControllerBase.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WpPepVN\\Form\\Element' not found in wp-content/plugins/wp-optimize-by-xtraffic/libs/WpPepVN/Form/Element/Submit.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WpPepVN\\DependencyInjection\\Injectable' not found in wp-content/plugins/wp-optimize-by-xtraffic/libs/WpPepVN/Mvc/View/Engine.php:15
    • > PHP Fatal error
      Cannot declare class Error, because the name is already in use in wp-content/plugins/wp-optimize-by-xtraffic/Application/Module/Backend/Controller/ErrorController.php on line 3
    • > PHP Warning
      Use of undefined constant WP_PEPVN_NS_SHORT - assumed 'WP_PEPVN_NS_SHORT' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-optimize-by-xtraffic/Application/configs/constant.php on line 18
    • > PHP Fatal error
      Uncaught Error: Interface 'WpPepVN\\Cache\\FrontendInterface' not found in wp-content/plugins/wp-optimize-by-xtraffic/libs/WpPepVN/Cache/Frontend/None.php:42

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (48 tag instead of maximum 10)
Please take inspiration from this readme.txt

wp-optimize-by-xtraffic/wp-optimize-by-xtraffic.php Passed 13 tests

The principal PHP file in "WP Optimize By xTraffic" v. 5.1.6 is loaded by WordPress automatically on each request
76 characters long description:
WP Optimize By xTraffic provides automatically optimize your WordPress site.

Code Analysis 97% from 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 detected116,988 lines of code in 287 files:
LanguageFilesBlank linesComment linesLines of code
PHP25510,44011,280105,775
CSS107227,374
JavaScript75821991,606
XML2511,551
SVG200289
Markdown2970207
JSON510165
YAML25019
HTML1001
Patran Command Language1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 211)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity25.45
▷ Minimum class complexity1.00
▷ Maximum class complexity643.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity211.00
Code structure
Namespaces46
Interfaces27
Traits0
Classes195
▷ Abstract classes157.69%
▷ Concrete classes18092.31%
▷ Final classes00.00%
Methods1,922
▷ Static methods36118.78%
▷ Public methods1,73390.17%
▷ Protected methods492.55%
▷ Private methods1407.28%
Functions90
▷ Named functions5763.33%
▷ Anonymous functions3336.67%
Constants182
▷ Global constants4725.82%
▷ Class constants13574.18%
▷ Public constants135100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/logo_128x128.png2.78KB2.86KB0.00%
public/images/icons/icon-greenplus.png0.22KB0.22KB0.00%
public/images/transparent-1x1.png0.09KB0.09KB0.00%
public/images/grey-1x1.png0.07KB0.08KB0.00%
public/images/white-1x1.png0.07KB0.08KB0.00%