72% contentad

Code Review | Content.ad

WordPress plugin Content.ad scored72%from 54 tests.

About plugin

  • Plugin page: contentad
  • Plugin version: 1.3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.6-5.5.1
  • WordPress version: 6.3.1
  • First release: Jul 30, 2012
  • Latest release: Nov 3, 2020
  • Number of updates: 114
  • Update frequency: every 26.5 days
  • Top authors: Content.ad (91.23%)NewClarity (9.65%)

Code review

54 tests

User reviews

16 reviews

Install metrics

400+ active /109,193 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Content.ad
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1243.91 ▲2.40
Dashboard /wp-admin3.38 ▲0.0352.21 ▼10.57
Posts /wp-admin/edit.php3.49 ▲0.1354.36 ▲1.41
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.28 ▼24.13
Media Library /wp-admin/upload.php3.30 ▲0.0739.73 ▲4.73
Settings /wp-admin/admin.php?page=contentad-settings3.26440.13
Widgets /wp-admin/edit.php?post_type=content_ad_widget3.3543.24

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 9 new options
New WordPress options
widget_contentad__includes__widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
contentad_version
contentad_install_key
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Content.ad
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.31 ▼0.071.71 ▼0.1138.45 ▼1.97
Dashboard /wp-admin2,212 ▲325.67 ▼0.0391.81 ▲6.9085.70 ▲39.96
Posts /wp-admin/edit.php2,129 ▲292.04 ▲0.0239.50 ▲3.3936.01 ▲0.19
Add New Post /wp-admin/post-new.php1,555 ▲1017.69 ▼5.48746.73 ▲54.1351.84 ▼9.21
Media Library /wp-admin/upload.php1,429 ▲264.18 ▼0.0294.82 ▼11.2976.03 ▲30.68
Settings /wp-admin/admin.php?page=contentad-settings8991.7932.4431.39
Widgets /wp-admin/edit.php?post_type=content_ad_widget1,1352.1145.4432.21

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • contentad_version
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_contentad__includes__widget
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=contentad-settings
    • > Notice in wp-content/plugins/contentad/includes/api.class.php+44
    Undefined variable: contentad_log

SRP 0% 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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/contentad/includes/tbclose.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contentad/contentad.php on line 37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contentad/includes/plugin-review.class.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/contentad/includes/widget.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/contentad/contentad.php:46
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contentad/contentad.php on line 38

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 need to be fixed:
  • Tags: Please reduce the number of tags, currently 24 tag instead of maximum 10
Please take inspiration from this readme.txt

contentad/contentad.php 92% from 13 tests

The main PHP file in "Content.ad" ver. 1.3.7 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 239 characters long)

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 plugin2,181 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP132271851,563
CSS1517295
JavaScript23022261
JSON10062

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.41
Average class complexity22.09
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods81
▷ Static methods5466.67%
▷ Public methods7795.06%
▷ Protected methods11.23%
▷ Private methods33.70%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ca_logo.png2.30KB2.30KB0.08%
images/sm_icon_active.png0.50KB0.38KB▼ 22.94%
images/big_red_x.png1.38KB1.31KB▼ 5.04%
images/sm_icon_inactive.png0.70KB0.55KB▼ 21.18%
images/ca_icon.png0.31KB0.31KB0.00%