72% ads-campaigns

Code Review | Ads Campaigns

WordPress plugin Ads Campaigns scored72%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: 6.3.1
  • 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

30+ active /10,719 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.77ms] Passed 4 tests

An overview of server-side resources used by Ads Campaigns
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.76 ▲1.70
Dashboard /wp-admin3.38 ▲0.0453.09 ▼4.56
Posts /wp-admin/edit.php3.49 ▲0.1447.04 ▲4.24
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.40 ▼27.25
Media Library /wp-admin/upload.php3.30 ▲0.0834.14 ▼0.96
Create a Google Ad /wp-admin/admin.php?page=ads-campaigns-create-google-ad3.2528.29
Create a Facebook Ad /wp-admin/admin.php?page=ads-campaigns-create-facebook-ad3.2529.49
Ads Dashboard /wp-admin/admin.php?page=ads-campaigns-dashboard3.2529.35

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Ads Campaigns: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.25 ▼0.371.67 ▼0.2838.73 ▼2.16
Dashboard /wp-admin2,224 ▲565.61 ▼0.0284.87 ▼5.0598.15 ▲48.29
Posts /wp-admin/edit.php2,132 ▲322.00 ▼0.0037.10 ▼3.0033.90 ▼0.88
Add New Post /wp-admin/post-new.php6,311 ▲4,79420.50 ▲6.09941.08 ▲506.6166.04 ▲20.78
Media Library /wp-admin/upload.php1,420 ▲264.19 ▼0.02102.30 ▲7.4169.21 ▲27.28
Create a Google Ad /wp-admin/admin.php?page=ads-campaigns-create-google-ad8352.7327.7826.04
Create a Facebook Ad /wp-admin/admin.php?page=ads-campaigns-create-facebook-ad8382.7328.4625.73
Ads Dashboard /wp-admin/admin.php?page=ads-campaigns-dashboard8352.7128.4728.75

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

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
These errors were triggered by the plugin
  • 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
  • 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-create-facebook-ad
    • > Notice in wp-content/plugins/ads-campaigns/wishpond-ads-helpers.php+44
    Undefined variable: out
  • 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > 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/register-assets.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-campaigns/meta-boxes.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ads-campaigns/menu.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
  • 6 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'".

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 71 tag instead of maximum 10
  • Screenshots: Add descriptions for screenshots #5, #6, #7, #8 in ads-campaigns/assets to your readme.txt
  • Donate link: Please fix this invalid url: "N/A"
The official readme.txt might help

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

The main PHP file in "Ads Campaigns" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
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 considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin582 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP108688479
JavaScript274494
CSS1009

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
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

All PNG images should be compressed to minimize bandwidth usage for end users
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
(invalid) assets/images/ajax-loader.png13.65KB0.00KB▼ 100.00%
assets/images/fb-ads.png3.32KB0.68KB▼ 79.37%