83% lazy-load-adsense

Code Review | Lazy Load AdSense

WordPress plugin Lazy Load AdSense scored83%from 54 tests.

About plugin

  • Plugin page: lazy-load-adsense
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2021
  • Latest release: Sep 5, 2023
  • Number of updates: 17
  • Update frequency: every 40.7 days
  • Top authors: jorcus (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /2,775 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.04MB] [CPU: ▼1.30ms] Passed 4 tests

A check of server-side resources used by Lazy Load AdSense
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.87 ▼2.71
Dashboard /wp-admin3.34 ▲0.0448.23 ▼6.74
Posts /wp-admin/edit.php3.46 ▲0.1051.48 ▼0.85
Add New Post /wp-admin/post-new.php5.92 ▲0.0494.18 ▲5.46
Media Library /wp-admin/upload.php3.26 ▲0.0439.18 ▲5.09
Lazy Load Adsense /wp-admin/options-general.php?page=lazyload-adsense-plugin3.2331.26

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

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

Browser metrics Passed 4 tests

Lazy Load AdSense: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.37 ▼0.201.60 ▲0.0041.38 ▼5.35
Dashboard /wp-admin2,199 ▲195.62 ▼0.0195.40 ▲0.4741.36 ▼1.14
Posts /wp-admin/edit.php2,104 ▲12.03 ▲0.0239.24 ▼1.1236.59 ▼2.00
Add New Post /wp-admin/post-new.php1,532 ▲623.41 ▲0.14628.60 ▼88.9754.72 ▼5.70
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.0696.89 ▼8.4845.92 ▲3.18
Lazy Load Adsense /wp-admin/options-general.php?page=lazyload-adsense-plugin8741.9921.8439.26

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lazy-load-adsense/admin/class-lazyload_adsense-admin.php:61

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Currently no screenshot available yet.) image required
You can take inspiration from this readme.txt

lazy-load-adsense/lazyload_adsense.php 85% from 13 tests

The primary PHP file in "Lazy Load AdSense" version 1.2.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("lazy-load-adsense.php" instead of "lazyload_adsense.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

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 detected166 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP776309166

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.19
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1376.47%
▷ Protected methods00.00%
▷ Private methods423.53%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin