94% wp-simple-ads

Code Review | Simple Ads

WordPress plugin Simple Ads scored 94% from 53 tests.

About plugin

  • Plugin page: wp-simple-ads
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-4.0.1
  • WordPress version: 5.8.1
  • First release: Aug 20, 2014
  • Latest release: Dec 2, 2014
  • Number of updates: 6
  • Update frequency: every 17.3 days
  • Top authors: shine.nazeer87 (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 1,083 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼282.83ms] Passed 4 tests

Analyzing server-side resources used by Simple Ads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1132.16 ▲10.37
Dashboard /wp-admin3.09 ▲0.0445.28 ▲4.23
Posts /wp-admin/edit.php3.15 ▲0.0442.02 ▼10.57
Add New Post /wp-admin/post-new.php4.69 ▼0.7452.94 ▼1,120.41
Media Library /wp-admin/upload.php3.04 ▲0.0332.01 ▼4.57

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Simple Ads
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,673 ▲9215.99 ▲0.476.83 ▼0.5543.85 ▼0.37
Dashboard /wp-admin2,957 ▲1045.91 ▲0.09135.91 ▼7.59101.84 ▼10.44
Posts /wp-admin/edit.php2,730 ▲242.70 ▲0.0168.30 ▲1.8193.51 ▼2.07
Add New Post /wp-admin/post-new.php1,869 ▼16719.07 ▲1.29349.20 ▼22.48109.16 ▲3.31
Media Library /wp-admin/upload.php1,737 ▼354.98 ▼0.03141.21 ▼2.43120.42 ▲0.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-simple-ads/script.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-simple-ads/sas_func.php:120
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-simple-ads/wp-simple-ads.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: ads, adsense, google adsense

wp-simple-ads/wp-simple-ads.php Passed 13 tests

The principal PHP file in "Simple Ads" v. 1.0 is loaded by WordPress automatically on each request
24 characters long description:
A simple plugin for Ads.

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
There were no executable files found in this plugin196 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32422196

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected