84% wp-relevant-ads

Code Review | WP Relevant Ads

WordPress plugin WP Relevant Ads scored 84% from 54 tests.

About plugin

  • Plugin page: wp-relevant-ads
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 5.9.2
  • First release: May 30, 2017
  • Latest release: Apr 6, 2017
  • Number of updates: 5
  • Update frequency: every 13.0 days
  • Top authors: SebeT (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 684 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲2.93MB] [CPU: ▼302.68ms] Passed 4 tests

An overview of server-side resources used by WP Relevant Ads
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.20 ▲2.6881.78 ▲29.42
Dashboard /wp-admin6.78 ▲3.3742.94 ▲5.06
Posts /wp-admin/edit.php6.78 ▲3.1444.09 ▲3.85
Add New Post /wp-admin/post-new.php9.49 ▲2.5296.03 ▼1,234.67
Media Library /wp-admin/upload.php6.78 ▲3.4840.28 ▲15.03

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 256 new files
Database: no new tables, 6 new options
New WordPress options
fs_api_cache
fs_debug_mode
wp-relevant-ad-cat_children
fs_active_plugins
widget_wp_relevant_ads_ad
fs_accounts

Browser metrics Passed 4 tests

Checking browser requirements for WP Relevant Ads
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,993 ▲23916.14 ▲0.489.25 ▲2.722.84 ▲0.44
Dashboard /wp-admin2,958 ▲976.24 ▲0.09117.62 ▼15.05165.14 ▲6.80
Posts /wp-admin/edit.php2,758 ▲733.26 ▲0.0264.12 ▲1.96160.94 ▲20.66
Add New Post /wp-admin/post-new.php1,711 ▼017.22 ▼3.95396.29 ▼70.59159.81 ▼0.61
Media Library /wp-admin/upload.php1,862 ▲1645.81 ▲0.34139.88 ▼2.19189.71 ▲2.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • fs_debug_mode
    • fs_api_cache
    • fs_accounts
    • fs_active_plugins
    • widget_wp_relevant_ads_ad
    • wp-relevant-ad-cat_children

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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-relevant-ads/includes/bc-framework/includes/wp-scb-framework/Widget.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/wp-relevant-ads/includes/bc-framework/includes/wp-scb-framework/BoxesPage.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'scbOptions' not found in wp-content/plugins/wp-relevant-ads/includes/options.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in wp-relevant-ads/assets to your readme.txt
Please take inspiration from this readme.txt

wp-relevant-ads/wp-relevant-ads.php Passed 13 tests

"WP Relevant Ads" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
88 characters long description:
Display relevant Ads or any other content based on their terms (categories, tags, etc..)

Code Analysis 97% 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
There were no executable files found in this plugin34,738 lines of code in 195 files:
LanguageFilesBlank linesComment linesLines of code
PHP1265,84712,12622,015
PO File62,1562,3285,658
JavaScript178085303,421
Sass16277821,713
CSS21246931,576
Markdown2680214
JSON400100
YAML22028
SVG10013

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,051)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity25.42
▷ Minimum class complexity1.00
▷ Maximum class complexity1,051.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes97
▷ Abstract classes1010.31%
▷ Concrete classes8789.69%
▷ Final classes11.15%
Methods1,177
▷ Static methods21017.84%
▷ Public methods88575.19%
▷ Protected methods978.24%
▷ Private methods19516.57%
Functions96
▷ Named functions96100.00%
▷ Anonymous functions00.00%
Constants98
▷ Global constants8081.63%
▷ Class constants1818.37%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
28 PNG files occupy 0.27MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
images/howto-call-to-action.png21.27KB6.34KB▼ 70.21%
images/howto-wrap-ads-in-blocks.png34.02KB14.09KB▼ 58.57%
admin/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
admin/js/select2/select2x2.png0.83KB0.77KB▼ 6.15%