78% resads

Code Review | ResAds

WordPress plugin ResAds scored78%from 54 tests.

About plugin

  • Plugin page: resads
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.2
  • WordPress version: 6.3.1
  • First release: Sep 8, 2015
  • Latest release: Apr 12, 2023
  • Number of updates: 41
  • Update frequency: every 67.7 days
  • Top authors: web-mv (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active /7,143 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.55MB] [CPU: ▲0.41ms] 75% from 4 tests

Server-side resources used by ResAds
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,656.29ms on /wp-admin/admin.php?page=resads)
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3042.53 ▲6.43
Dashboard /wp-admin3.96 ▲0.6551.30 ▼0.97
Posts /wp-admin/edit.php4.00 ▲0.6453.70 ▲5.12
Add New Post /wp-admin/post-new.php6.60 ▲0.7187.28 ▼7.57
Media Library /wp-admin/upload.php3.84 ▲0.6139.73 ▲5.08
ResAds /wp-admin/admin.php?page=resads4.891,656.29
AdManagement /wp-admin/admin.php?page=resads-admanagement3.7840.79
Settings /wp-admin/admin.php?page=resads-settings3.8136.74
AdSpots /wp-admin/admin.php?page=resads-adspots3.7833.05

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 56 new files
Database: 5 new tables, 8 new options
New tables
wp_resads_adspot
wp_resads_resolution
wp_resads_ad
wp_resads_ad_adspot
wp_resads_ad_statistik
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_resads_adspot_widget
db_upgraded
resads_version

Browser metrics Passed 4 tests

An overview of browser requirements for ResAds
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲20914.44 ▲0.076.05 ▲4.3039.29 ▼3.84
Dashboard /wp-admin2,257 ▲725.15 ▼0.74111.98 ▲0.9979.47 ▲34.02
Posts /wp-admin/edit.php2,145 ▲532.50 ▲0.4437.34 ▼2.5436.21 ▲1.61
Add New Post /wp-admin/post-new.php1,712 ▲19222.67 ▼0.59672.86 ▼30.7430.40 ▼24.21
Media Library /wp-admin/upload.php1,430 ▲424.51 ▲0.35103.93 ▲6.9773.78 ▲29.94
ResAds /wp-admin/admin.php?page=resads1,2875.7880.7888.94
AdManagement /wp-admin/admin.php?page=resads-admanagement1,0451.9329.9128.77
Settings /wp-admin/admin.php?page=resads-settings1,1825.0750.0050.07
AdSpots /wp-admin/admin.php?page=resads-adspots1,0391.9627.1426.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_resads_adspot_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 take a closer look at the following
  • 17× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/resads/templates/adspot/new.php
    • > /wp-content/plugins/resads/class/AdSpot.php
    • > /wp-content/plugins/resads/class/AdManagement.php
    • > /wp-content/plugins/resads/templates/adspot/edit.php
    • > /wp-content/plugins/resads/templates/admanagement/admanagement.php
    • > /wp-content/plugins/resads/class/Dashboard.php
    • > /wp-content/plugins/resads/templates/dashboard/dashboard.php
    • > /wp-content/plugins/resads/templates/admanagement/new.php
    • > /wp-content/plugins/resads/class/ResAds.php
    • > /wp-content/plugins/resads/templates/adspot/adspot.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/resads/resads.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/resads/functions.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5, #6, #7, #8 in resads/assets to your readme.txt
  • Tags: Please delete some tags, you are using 26 tag instead of maximum 10
You can take inspiration from this readme.txt

resads/resads.php Passed 13 tests

Analyzing the main PHP file in "ResAds" version 2.0.5
60 characters long description:
ResAds makes your advertising responsive and track your ads.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin2,998 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP192537062,492
JavaScript7475242
PO File1106128224
CSS32240

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity26.74
▷ Minimum class complexity2.00
▷ Maximum class complexity99.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods136
▷ Static methods107.35%
▷ Public methods13297.06%
▷ Protected methods00.00%
▷ Private methods42.94%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/align-right.png1.26KB0.30KB▼ 75.78%
js/tinymce/adspot-button.png1.28KB0.32KB▼ 74.60%
img/top-right.png1.20KB0.27KB▼ 77.78%
img/bottom-right.png1.19KB0.26KB▼ 77.71%
img/align-left.png1.28KB0.32KB▼ 74.60%