78% leospeed

Code Review | Leospeed

WordPress plugin Leospeed scored78%from 54 tests.

About plugin

  • Plugin page: leospeed
  • Plugin version: 4.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Jan 16, 2023
  • Latest release: Sep 12, 2023
  • Number of updates: 8
  • Update frequency: every 40.8 days
  • Top authors: manpreet2760 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,169 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.39MB] [CPU: ▼4.51ms] Passed 4 tests

Analyzing server-side resources used by Leospeed
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3944.87 ▲8.31
Dashboard /wp-admin3.74 ▲0.4053.99 ▼3.34
Posts /wp-admin/edit.php3.79 ▲0.4448.89 ▲1.33
Add New Post /wp-admin/post-new.php6.28 ▲0.4084.11 ▼22.01
Media Library /wp-admin/upload.php3.60 ▲0.3841.63 ▲6.00
Leospeed Settings /wp-admin/options-general.php?page=sx-setting-admin3.5738.28

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 74 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Leospeed
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲11214.56 ▲0.191.73 ▲0.0444.13 ▲2.23
Dashboard /wp-admin2,256 ▲685.99 ▲1.08106.38 ▲3.2139.15 ▼7.10
Posts /wp-admin/edit.php2,118 ▲262.65 ▲0.6148.00 ▲5.8034.26 ▼3.15
Add New Post /wp-admin/post-new.php1,548 ▲3424.07 ▲6.37679.20 ▲10.8339.24 ▼17.57
Media Library /wp-admin/upload.php1,438 ▲475.11 ▲0.92102.67 ▲7.0241.55 ▼3.87
Leospeed Settings /wp-admin/options-general.php?page=sx-setting-admin1,6092.3331.5236.81

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
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/leospeed/public/js/dashboard.controller.php
    • > /wp-content/plugins/leospeed/public/js/activation.controller.php
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > 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/leospeed/includes/constant.php on line 29
    • > 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/leospeed/includes/constant.php on line 29
    • > 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/leospeed/includes/constant.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/leospeed/templates/setting.php:2
    • > 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/leospeed/includes/constant.php on line 29
    • > 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/leospeed/includes/constant.php on line 29
    • > 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/leospeed/includes/constant.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/leospeed/templates/container.php:2
    • > 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/leospeed/includes/constant.php on line 29
    • > 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/leospeed/includes/constant.php on line 29

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
The official readme.txt is a good inspiration

leospeed/leospeed.php 92% from 13 tests

This is the main PHP file of "Leospeed" version 4.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 376 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin17,698 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript83,03618,99513,132
PHP333863492,967
SVG807531
CSS3969528
Sass21080526
JSON20014

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity15.38
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods100
▷ Static methods2929.00%
▷ Public methods9393.00%
▷ Protected methods00.00%
▷ Private methods77.00%
Functions42
▷ Named functions3685.71%
▷ Anonymous functions614.29%
Constants58
▷ Global constants5594.83%
▷ Class constants35.17%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 2.46MB with 1.28MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/danger.png25.90KB8.52KB▼ 67.13%
public/images/resource.png2,484.82KB897.69KB▼ 63.87%
public/images/leo.png1.07KB1.24KB0.00%
public/images/sonicx-logo.png2.80KB0.61KB▼ 78.18%