83% lh-save-down

Code Review | LH Save Down

WordPress plugin LH Save Down scored83%from 54 tests.

About plugin

  • Plugin page: lh-save-down
  • Plugin version: 2.20
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 25, 2015
  • Latest release: Jul 29, 2022
  • Number of updates: 15
  • Update frequency: every 179.0 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,128 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼11.85ms] Passed 4 tests

Analyzing server-side resources used by LH Save Down
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.02 ▼3.10
Dashboard /wp-admin3.32 ▼0.0242.44 ▼17.73
Posts /wp-admin/edit.php3.44 ▲0.0844.75 ▼4.29
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.16 ▼22.28
Media Library /wp-admin/upload.php3.24 ▲0.0235.60 ▼0.73

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

A short overview of filesystem and database impact
Just a few items left to fix
  • Filesystem usage must be lower than 25MB (currently using 92.43MB)
Filesystem: 688 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for LH Save Down
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.22 ▼0.141.56 ▲0.0837.54 ▼3.61
Dashboard /wp-admin2,198 ▲215.52 ▼0.1382.03 ▼2.0535.85 ▼10.40
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0433.04 ▼2.4835.23 ▲1.15
Add New Post /wp-admin/post-new.php1,526 ▼223.07 ▼0.06701.28 ▲54.8256.33 ▲2.11
Media Library /wp-admin/upload.php1,397 ▲64.21 ▲0.0394.79 ▼3.2941.51 ▼4.58

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 50% 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
Please fix the following items
  • 233× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/mpdf/mpdf/src/TTFontFile.php on line 49
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/mpdf/mpdf/src/Barcode/I25.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/mpdf/mpdf/src/Tag/A.php:5
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.16. in wp-content/plugins/lh-save-down/lib/mpdf_new/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Interface 'Mpdf\\Container\\ContainerInterface' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/mpdf/mpdf/src/Container/SimpleContainer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/mpdf/mpdf/src/Barcode/BarcodeException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/setasign/fpdi/src/PdfParser/Type/PdfName.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/setasign/fpdi/src/PdfParser/Filter/FlateException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/lh-save-down/lib/mpdf_new/mpdf/mpdf/src/Tag/Input.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: text, html, attachment, post, template...

lh-save-down/lh-save-down.php 92% from 13 tests

The main PHP file in "LH Save Down" ver. 2.20 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin82,730 lines of code in 462 files:
LanguageFilesBlank linesComment linesLines of code
PHP41912,36614,69779,539
Markdown1446101,279
JSON1300786
CSS37619534
HTML230318
YAML7584196
XML310075
Bourne Shell1203

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 7,024)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity54.53
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity11.84
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces48
Interfaces25
Traits6
Classes311
▷ Abstract classes82.57%
▷ Concrete classes30397.43%
▷ Final classes144.62%
Methods1,763
▷ Static methods1639.25%
▷ Public methods1,54287.46%
▷ Protected methods724.08%
▷ Private methods1498.45%
Functions29
▷ Named functions620.69%
▷ Anonymous functions2379.31%
Constants587
▷ Global constants50.85%
▷ Class constants58299.15%
▷ Public constants582100.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