79% lh-multisite-ads

Code Review | LH Multisite Ads

WordPress plugin LH Multisite Ads scored79%from 54 tests.

About plugin

  • Plugin page: lh-multisite-ads
  • Plugin version: 1.26
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Feb 16, 2016
  • Latest release: Sep 8, 2019
  • Number of updates: 10
  • Update frequency: every 130.1 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /3,815 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.25MB] [CPU: ▼14.32ms] Passed 4 tests

Server-side resources used by LH Multisite Ads
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0433.48 ▼7.56
Dashboard /wp-admin3.39 ▲0.0950.22 ▼4.14
Posts /wp-admin/edit.php3.50 ▲0.1450.59 ▲2.35
Add New Post /wp-admin/post-new.php4.68 ▼1.2146.70 ▼46.11
Media Library /wp-admin/upload.php3.31 ▲0.0838.02 ▲0.55
Add New /wp-admin/post-new.php?post_type=lh-multisite-ads3.3244.59
Post Adverts /wp-admin/edit.php?post_type=lh-multisite-ads3.3538.44
Settings /wp-admin/edit.php?post_type=lh-multisite-ads&page=lh-multisite-ads/lh-multisite-ads.php3.2830.58

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for LH Multisite Ads
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6213.30 ▼1.064.89 ▲3.0646.58 ▲0.93
Dashboard /wp-admin2,229 ▲495.66 ▼0.0689.42 ▲0.4738.16 ▼1.83
Posts /wp-admin/edit.php2,128 ▲282.02 ▼0.0240.51 ▲0.9534.99 ▼1.72
Add New Post /wp-admin/post-new.php1,571 ▲4522.99 ▲5.36575.54 ▼33.4554.00 ▼6.55
Media Library /wp-admin/upload.php1,431 ▲344.29 ▼0.0397.75 ▼2.8145.89 ▲0.35
Add New /wp-admin/post-new.php?post_type=lh-multisite-ads1,5542.5549.7571.83
Post Adverts /wp-admin/edit.php?post_type=lh-multisite-ads1,1031.9331.4931.37
Settings /wp-admin/edit.php?post_type=lh-multisite-ads&page=lh-multisite-ads/lh-multisite-ads.php8482.0527.0027.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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)
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=lh-multisite-ads
    • > Notice in wp-content/plugins/lh-multisite-ads/lh-multisite-ads.php+167
    Undefined property: LH_multisite_ads_plugin::$plugin
    • > GET request to /wp-admin/post-new.php?post_type=lh-multisite-ads
    • > Notice in wp-content/plugins/lh-multisite-ads/lh-multisite-ads.php+167
    Trying to get property 'name' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=lh-multisite-ads&page=lh-multisite-ads/lh-multisite-ads.php
    • > Notice in wp-content/plugins/lh-multisite-ads/partials/option-settings.php+17
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/edit.php?post_type=lh-multisite-ads&page=lh-multisite-ads/lh-multisite-ads.php
    • > Warning in wp-content/plugins/lh-multisite-ads/partials/option-settings.php+9
    implode(): Invalid arguments passed
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=lh-multisite-ads&page=lh-multisite-ads/lh-multisite-ads.php
    • > Notice in wp-content/plugins/lh-multisite-ads/partials/option-settings.php+15
    Undefined property: LH_multisite_ads_plugin::$use_email_field_name

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/lh-multisite-ads/partials/option-settings.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 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
5 plugin tags: google adsense, advertising, adsense, ads, multisite

lh-multisite-ads/lh-multisite-ads.php Passed 13 tests

The main file in "LH Multisite Ads" v. 1.26 serves as a complement to information provided in readme.txt and as the entry point to the plugin
96 characters long description:
Allows you to insert ads after paragraphs of your post content throughout your multisite network

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin300 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP220980300

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity54.00
▷ Minimum class complexity54.00
▷ Maximum class complexity54.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods15.26%
▷ Public methods1684.21%
▷ Protected methods00.00%
▷ Private methods315.79%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin