73% wp-visual-adverts

Code Review | WP Visual Adverts

WordPress plugin WP Visual Adverts scored 73% from 54 tests.

About plugin

  • Plugin page: wp-visual-adverts
  • Plugin version: 2.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.5
  • WordPress version: 6.3.1
  • First release: Mar 24, 2015
  • Latest release: Jun 15, 2016
  • Number of updates: 48
  • Update frequency: every 9.4 days
  • Top authors: webcodin (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 9,748 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▲6.18ms] Passed 4 tests

An overview of server-side resources used by WP Visual Adverts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4947.03 ▲4.59
Dashboard /wp-admin3.83 ▲0.5354.35 ▲6.86
Posts /wp-admin/edit.php3.85 ▲0.5062.04 ▲13.48
Add New Post /wp-admin/post-new.php6.48 ▲0.6095.60 ▲3.76
Media Library /wp-admin/upload.php3.79 ▲0.5745.15 ▲9.49
Categories /wp-admin/edit-tags.php?taxonomy=advert-category&post_type=adverts3.7444.88
Settings /wp-admin/admin.php?page=adverts-settings3.6639.67
Adverts /wp-admin/edit.php?post_type=adverts3.7545.75

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

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

Browser metrics Passed 4 tests

WP Visual Adverts: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲21014.15 ▼0.285.92 ▲3.5640.96 ▼9.70
Dashboard /wp-admin2,256 ▲685.17 ▲0.29109.91 ▼0.9739.94 ▼2.59
Posts /wp-admin/edit.php2,126 ▲372.33 ▲0.2936.66 ▼5.2532.53 ▼1.94
Add New Post /wp-admin/post-new.php1,563 ▲2923.32 ▲0.02641.65 ▼31.1634.71 ▼15.89
Media Library /wp-admin/upload.php1,448 ▲634.45 ▲0.2590.93 ▼10.7745.93 ▼1.00
Categories /wp-admin/edit-tags.php?taxonomy=advert-category&post_type=adverts1,3232.0631.4729.72
Settings /wp-admin/admin.php?page=adverts-settings1,1321.9628.3136.86
Adverts /wp-admin/edit.php?post_type=adverts1,0982.2735.9828.27

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_rpadv_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=adverts-settings
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=adverts-settings
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/render-tabs.php
    • > /wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/fields/repeater/header.php
    • > /wp-content/plugins/wp-visual-adverts/templates/admin/options/fields/select.php
    • > /wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/fields/select.php
  • 145× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/render-page.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-visual-adverts/templates/admin/options/fields/select.php on line 15
    • > PHP Notice
      Trying to get property 'field' of non-object in wp-content/plugins/wp-visual-adverts/templates/admin/options/fields/checkbox.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/fields/select.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/fields/textarea.php:15
    • > PHP Notice
      Trying to get property 'fields' of non-object in wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/fields/select.php on line 15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/fields/select.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'Webcodin\\WPVisualAdverts\\Core\\Agp_DbAbstract' not found in wp-content/plugins/wp-visual-adverts/agp-core/classes/database/Agp_MySqlDb.class.php:4
    • > PHP Notice
      Trying to get property 'field' of non-object in wp-content/plugins/wp-visual-adverts/agp-core/templates/admin/options/fields/hidden.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function RPAdv() in wp-content/plugins/wp-visual-adverts/templates/rpadv-widget.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

wp-visual-adverts/wp-visual-adverts.php Passed 13 tests

"WP Visual Adverts" version 2.3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
66 characters long description:
A plugin for WordPress that let you add visual adverts to sidebars

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected3,412 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
PHP646494903,180
CSS3750115
JavaScript4220107
Markdown2409
JSON1001

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.37
Average class complexity12.32
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes27
▷ Abstract classes933.33%
▷ Concrete classes1866.67%
▷ Final classes00.00%
Methods331
▷ Static methods82.42%
▷ Public methods32798.79%
▷ Protected methods00.00%
▷ Private methods41.21%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/icon-128x128.png23.62KB6.97KB▼ 70.47%