78% lh-backup

Code Review | LH Backup

WordPress plugin LH Backup scored78%from 54 tests.

About plugin

  • Plugin page: lh-backup
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 14, 2015
  • Latest release: Aug 21, 2015
  • Number of updates: 4
  • Update frequency: every 47.5 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.40ms] Passed 4 tests

Analyzing server-side resources used by LH Backup
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.97 ▼5.34
Dashboard /wp-admin3.44 ▲0.1373.38 ▲23.71
Posts /wp-admin/edit.php3.41 ▲0.0548.99 ▲2.18
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.44 ▼7.58
Media Library /wp-admin/upload.php3.28 ▲0.0533.65 ▼2.85
LH Backup /wp-admin/options-general.php?page=lh-backup/lh-backup.php3.2229.75

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

LH Backup: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.20 ▼1.474.49 ▲2.5042.01 ▼0.23
Dashboard /wp-admin2,210 ▲225.88 ▼0.01106.12 ▼4.3538.36 ▼3.44
Posts /wp-admin/edit.php2,093 ▲11.99 ▲0.0139.50 ▼0.2236.06 ▲1.72
Add New Post /wp-admin/post-new.php1,517 ▼2517.67 ▼5.53674.08 ▲4.8360.43 ▲5.61
Media Library /wp-admin/upload.php1,395 ▲104.23 ▼0.0195.50 ▼18.9843.89 ▼4.51
LH Backup /wp-admin/options-general.php?page=lh-backup/lh-backup.php8162.0229.4126.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-backup/lh-backup.php
    • > Notice in wp-content/plugins/lh-backup/lh-backup.php+367
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-backup/lh-backup.php
    • > Warning in wp-content/plugins/lh-backup/lh-backup.php+367
    implode(): Invalid arguments passed

SRP 50% 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 have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/lh-backup/lh-backup.php:401

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Requires at least: Version not formatted correctly
Please take inspiration from this readme.txt

lh-backup/lh-backup.php Passed 13 tests

Analyzing the main PHP file in "LH Backup" version 1.1
49 characters long description:
Creates an email backup of tables in the database

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
Success! There were no dangerous files found in this plugin202 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP120435202

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods960.00%
▷ Protected methods00.00%
▷ Private methods640.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin