84% setupad

Code Review | Setupad WP Ads

WordPress plugin Setupad WP Ads scored84%from 54 tests.

About plugin

  • Plugin page: setupad
  • Plugin version: 1.4.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Mar 6, 2023
  • Latest release: Oct 30, 2023
  • Number of updates: 37
  • Update frequency: every 6.9 days
  • Top authors: setupad (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /967 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼6.81ms] Passed 4 tests

This is a short check of server-side resources used by Setupad WP Ads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1545.76 ▲6.12
Dashboard /wp-admin3.57 ▲0.2245.35 ▼17.02
Posts /wp-admin/edit.php3.68 ▲0.3345.79 ▼1.98
Add New Post /wp-admin/post-new.php6.15 ▲0.2682.42 ▼5.51
Media Library /wp-admin/upload.php3.49 ▲0.2635.14 ▼2.72
Related Posts /wp-admin/admin.php?page=stpd-related-posts3.5537.07
Add new /wp-admin/admin.php?page=stpd-new_ad4.0237.71
Ads.txt /wp-admin/admin.php?page=stpd-ads_txt3.4631.83
Header/Footer /wp-admin/admin.php?page=stpd-header-footer3.4631.94
My ads /wp-admin/admin.php?page=setupad3.5934.56

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 490 new files
Database: 3 new tables, 7 new options
New tables
wp_setupad_ads_txt
wp_setupad_settings
wp_setupad
New WordPress options
can_compress_scripts
theysaidso_admin_options
setupad_db_version
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Setupad WP Ads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲17013.81 ▼0.548.55 ▲6.9045.05 ▲2.45
Dashboard /wp-admin2,251 ▲705.62 ▼0.0688.16 ▼15.1038.70 ▼2.84
Posts /wp-admin/edit.php2,162 ▲621.97 ▼0.0535.25 ▼1.7830.75 ▼3.94
Add New Post /wp-admin/post-new.php1,560 ▲3423.13 ▲0.19690.07 ▼22.6552.72 ▲0.96
Media Library /wp-admin/upload.php1,457 ▲574.27 ▲0.0995.11 ▼16.3644.06 ▲1.30
Related Posts /wp-admin/admin.php?page=stpd-related-posts1,6163.1075.7437.52
Add new /wp-admin/admin.php?page=stpd-new_ad3,4213.6684.8169.59
Ads.txt /wp-admin/admin.php?page=stpd-ads_txt9522.0123.5735.50
Header/Footer /wp-admin/admin.php?page=stpd-header-footer1,1173.2769.7038.39
My ads /wp-admin/admin.php?page=setupad1,0021.8124.4529.02

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • setupad_db_version
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 70× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/setupad/admin/includes/database/create-update-related-posts.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/setupad/public/includes/related-posts.php:105
    • > PHP Warning
      array_search() expects parameter 2 to be array, null given in wp-content/plugins/setupad/admin/includes/forms/setupad-related-posts-form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/setupad/public/includes/ad-placement/after-post.php:20
    • > PHP Warning
      include_once(): Failed opening 'SETUPAD_BASE_PATHpublic/includes/helper-functions.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/setupad/public/includes/ad-placement/the-content.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/setupad/public/includes/ad-placement/before-after-excerpt.php:48
    • > PHP Warning
      Use of undefined constant SETUPAD_BASE_PATH - assumed 'SETUPAD_BASE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/setupad/public/includes/ad-placement/sidebar-bottom.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_charset_collate() on null in wp-content/plugins/setupad/admin/includes/database/setupad-tables-upgrade.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/setupad/public/includes/add-setupad-shortcode.php:19
    • > PHP Warning
      Use of undefined constant SETUPAD_BASE_PATH - assumed 'SETUPAD_BASE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/setupad/public/includes/ad-placement/in-footer.php on line 2

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: ads, advertising, ad manager, wordpress ads, adsense...

setupad/setupad.php 92% from 13 tests

The entry point to "Setupad WP Ads" version 1.4.5 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin11,027 lines of code in 486 files:
LanguageFilesBlank linesComment linesLines of code
PHP348908225,418
JavaScript447599574,100
CSS2160231,259
Markdown11130233
SVG20117

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.82
Average class complexity52.50
▷ Minimum class complexity48.00
▷ Maximum class complexity57.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods42
▷ Static methods716.67%
▷ Public methods3992.86%
▷ Protected methods24.76%
▷ Private methods12.38%
Functions65
▷ Named functions5787.69%
▷ Anonymous functions812.31%
Constants10
▷ Global constants660.00%
▷ Class constants440.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/plugin_logo.png0.75KB0.76KB0.00%