82% ads-campaigns

Code Review | Ads Campaigns

WordPress plugin Ads Campaigns scored 82% from 54 tests.

About plugin

  • Plugin page: ads-campaigns
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.0
  • WordPress version: 5.9.2
  • First release: Mar 26, 2014
  • Latest release: Nov 19, 2015
  • Number of updates: 95
  • Update frequency: every 6.4 days
  • Top authors: alitaj (90.53%)mateustav (10.53%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 10,387 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼300.83ms] Passed 4 tests

A check of server-side resources used by Ads Campaigns
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0259.88 ▲8.84
Dashboard /wp-admin3.43 ▲0.0236.33 ▼7.58
Posts /wp-admin/edit.php3.66 ▲0.0241.49 ▼0.57
Add New Post /wp-admin/post-new.php6.90 ▼0.07102.39 ▼1,201.17
Media Library /wp-admin/upload.php3.31 ▲0.0129.97 ▲5.99
Create a Google Ad /wp-admin/admin.php?page=ads-campaigns-create-google-ad3.2524.62
Create a Facebook Ad /wp-admin/admin.php?page=ads-campaigns-create-facebook-ad3.2530.65
Ads Dashboard /wp-admin/admin.php?page=ads-campaigns-dashboard3.2531.85

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Ads Campaigns
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,798 ▲5615.83 ▲0.136.78 ▲0.442.52 ▲0.33
Dashboard /wp-admin2,929 ▲686.15 ▼0.04123.94 ▼4.42201.37 ▲42.69
Posts /wp-admin/edit.php2,723 ▲383.11 ▼0.1263.16 ▼10.09144.44 ▼6.98
Add New Post /wp-admin/post-new.php1,860 ▲22516.90 ▲0.61453.20 ▼21.59218.54 ▲56.75
Media Library /wp-admin/upload.php1,729 ▲345.46 ▼0.08130.13 ▼29.84199.82 ▼16.35
Create a Google Ad /wp-admin/admin.php?page=ads-campaigns-create-google-ad1,0312.9157.7987.57
Create a Facebook Ad /wp-admin/admin.php?page=ads-campaigns-create-facebook-ad1,0282.9452.5689.71
Ads Dashboard /wp-admin/admin.php?page=ads-campaigns-dashboard1,0262.9256.8694.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ads-campaigns-create-facebook-ad
    • > Notice in wp-content/plugins/ads-campaigns/menu.php+73
    Undefined index: post_id
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ads-campaigns-create-facebook-ad
    • > Notice in wp-content/plugins/ads-campaigns/wishpond-ads-helpers.php+44
    Undefined variable: out
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ads-campaigns-create-facebook-ad
    • > Notice in wp-content/plugins/ads-campaigns/wishpond-ads-helpers.php+27
    Trying to get property 'post_content' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ads-campaigns-dashboard
    • > Notice in wp-content/plugins/ads-campaigns/menu.php+61
    Undefined variable: html

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ads-campaigns/menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-campaigns/register-assets.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ads-campaigns/ads-campaigns.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-campaigns/meta-boxes.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ads-campaigns-dashboard
    • > Security (severe) in unknown
    security - Refused to frame 'https://www.wishpond.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".
    • > GET request to /wp-admin/admin.php?page=ads-campaigns-dashboard
    • > Network (severe)
    https://www.wishpond.com/central/ad_campaigns?utm_campaign=Wordpress&utm_source=wordpress.com&utm_medium=Ads+Campaigns - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #5, #6, #7, #8 in ads-campaigns/assets to your readme.txt
  • Tags: There are too many tags (71 tag instead of maximum 10)
  • Donate link: Invalid URI found ("")
The official readme.txt is a good inspiration

ads-campaigns/ads-campaigns.php Passed 13 tests

This is the main PHP file of "Ads Campaigns" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
63 characters long description:
Create Ads with Google Adwords and Facebook Ads from Wordpress!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin582 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP108688479
JavaScript274494
CSS1009

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.50
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods25
▷ Static methods1560.00%
▷ Public methods2496.00%
▷ Protected methods00.00%
▷ Private methods14.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants444.44%
▷ Class constants555.56%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/fb-ads.png3.32KB0.68KB▼ 79.37%
(invalid) assets/images/ajax-loader.png13.65KB0.00KB▼ 100.00%