84% perfect-lazy-loading

Code Review | Perfect Lazy Loading

WordPress plugin Perfect Lazy Loading scored84%from 54 tests.

About plugin

  • Plugin page: perfect-lazy-loading
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 8, 2018
  • Latest release: Oct 12, 2018
  • Number of updates: 6
  • Update frequency: every 1.0 days
  • Top authors: loremipsumgraz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /767 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.73MB] [CPU: ▼6.32ms] Passed 4 tests

An overview of server-side resources used by Perfect Lazy Loading
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.416.26 ▼35.71
Dashboard /wp-admin4.74 ▲1.4458.21 ▲7.42
Posts /wp-admin/edit.php4.86 ▲1.5057.56 ▲5.35
Add New Post /wp-admin/post-new.php7.32 ▲1.4493.37 ▼0.87
Media Library /wp-admin/upload.php4.67 ▲1.4445.43 ▲5.97
Import / Export /wp-admin/admin.php?page=perfect_lazy_loading_import_export_settings8.6667.22
Settings /wp-admin/admin.php?page=perfect_lazy_loading_settings8.8072.00

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 234 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Perfect Lazy Loading
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲5513.74 ▼0.462.11 ▲0.1046.89 ▲2.33
Dashboard /wp-admin2,220 ▲285.83 ▲0.8099.69 ▼10.5978.63 ▲37.34
Posts /wp-admin/edit.php2,115 ▲262.00 ▼0.0137.82 ▼0.0236.26 ▼2.62
Add New Post /wp-admin/post-new.php1,548 ▲1418.45 ▼4.71693.75 ▲55.8063.16 ▲9.30
Media Library /wp-admin/upload.php1,405 ▲174.18 ▼0.01100.67 ▼3.0273.18 ▲28.55
Import / Export /wp-admin/admin.php?page=perfect_lazy_loading_import_export_settings1,0142.1436.6365.62
Settings /wp-admin/admin.php?page=perfect_lazy_loading_settings1,1472.1033.0147.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 199× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_View___Attribute_Base' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/_common/form/_view/attribute/AdminPageFramework_Form_View___Attribute_SectionTableContainer.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_HelpPane_Base' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/term_meta/_controller/AdminPageFramework_HelpPane_term_meta.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_View___CSS_Base' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/widget/form/_view/AdminPageFramework_Form_View___CSS_widget.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Format_Base' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/admin_page/_model/format/AdminPageFramework_Format_NavigationTab_InPageTab.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_FieldType' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/_common/form/field_type/AdminPageFramework_FieldType_inline_mixed.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Property_admin_page' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/network_admin_page/_model/AdminPageFramework_Property_network_admin_page.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Property_Base' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/meta_box/_model/AdminPageFramework_Property_post_meta_box.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Factory_Model___Meta_Base' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/term_meta/_model/AdminPageFramework_TermMeta_Model___TermMeta.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_Utility' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/_common/form/_view/fieldset/AdminPageFramework_Form_View___Fieldset.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_View___Script_Base' not found in wp-content/plugins/perfect-lazy-loading/lib/apf/factory/_common/form/_view/script/AdminPageFramework_Form_View___Script_SortableSection.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: autosize, lazy loading, seo

perfect-lazy-loading/perfect-lazy-loading.php 92% from 13 tests

"Perfect Lazy Loading" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected16,997 lines of code in 225 files:
LanguageFilesBlank linesComment linesLines of code
PHP2176251,66715,989
PO File6386402945
JavaScript18044
SVG10019

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.09
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes326
▷ Abstract classes9328.53%
▷ Concrete classes23371.47%
▷ Final classes20.86%
Methods1,684
▷ Static methods24414.49%
▷ Public methods93355.40%
▷ Protected methods26715.86%
▷ Private methods48428.74%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants17
▷ Global constants317.65%
▷ Class constants1482.35%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/menu_icon.png0.48KB0.36KB▼ 26.17%