84% native-lazyload-polyfill

Code Review | Native Lazyload + Polyfill

WordPress plugin Native Lazyload + Polyfill scored84%from 54 tests.

About plugin

  • Plugin page: native-lazyload-p...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 26, 2019
  • Latest release: Oct 11, 2019
  • Number of updates: 18
  • Update frequency: every 2.6 days
  • Top authors: nico23 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,931 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼7.82ms] Passed 4 tests

A check of server-side resources used by Native Lazyload + Polyfill
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1439.96 ▼0.60
Dashboard /wp-admin3.50 ▲0.1550.63 ▼11.39
Posts /wp-admin/edit.php3.51 ▲0.1646.47 ▼5.84
Add New Post /wp-admin/post-new.php5.98 ▲0.1085.65 ▼13.44
Media Library /wp-admin/upload.php3.32 ▲0.1044.17 ▲5.80

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Native Lazyload + Polyfill
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲5214.26 ▼0.092.45 ▲0.8338.66 ▼1.57
Dashboard /wp-admin2,192 ▲125.52 ▼0.1584.51 ▼11.7237.64 ▼1.94
Posts /wp-admin/edit.php2,099 ▼11.96 ▲0.0136.37 ▼4.6933.35 ▼3.52
Add New Post /wp-admin/post-new.php1,529 ▼923.23 ▲0.19663.56 ▲5.4551.29 ▼3.89
Media Library /wp-admin/upload.php1,405 ▲54.17 ▼0.0699.48 ▼5.3348.09 ▼0.05

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Trait 'IvoPetkov\\HTML5DOMDocument\\Internal\\QuerySelectors' not found in wp-content/plugins/native-lazyload-polyfill/vendor/ivopetkov/html5-dom-document-php/src/HTML5DOMElement.php on line 19
    • > PHP Fatal error
      Trait 'IvoPetkov\\HTML5DOMDocument\\Internal\\QuerySelectors' not found in wp-content/plugins/native-lazyload-polyfill/vendor/ivopetkov/html5-dom-document-php/src/HTML5DOMDocument.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Nextgenthemes\ativeLazyloadPolyfill\\add_action() in wp-content/plugins/native-lazyload-polyfill/native-lazyload-polyfill.php:29

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: iframe, polyfill, images, lazyload, loading...

native-lazyload-polyfill/native-lazyload-polyfill.php 85% from 13 tests

The entry point to "Native Lazyload + Polyfill" version 1.1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Description: Keep the plugin description shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,929 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP152515221,681
JavaScript23666145
JSON30093
HTML11010

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity45.25
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces4
Interfaces0
Traits1
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods62
▷ Static methods34.84%
▷ Public methods5385.48%
▷ Protected methods00.00%
▷ Private methods914.52%
Functions39
▷ Named functions1230.77%
▷ Anonymous functions2769.23%
Constants11
▷ Global constants00.00%
▷ Class constants11100.00%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin