84% ads-for-old-posts

Code Review | Ads For Old Posts

WordPress plugin Ads For Old Posts scored 84% from 54 tests.

About plugin

  • Plugin page: ads-for-old-posts
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-5.0
  • WordPress version: 5.9.2
  • First release: Apr 5, 2009
  • Latest release: Dec 8, 2018
  • Number of updates: 26
  • Update frequency: every 135.9 days
  • Top authors: vegasgeek (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 5,618 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼296.52ms] Passed 4 tests

This is a short check of server-side resources used by Ads For Old Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0457.69 ▲5.29
Dashboard /wp-admin3.44 ▲0.0435.17 ▲0.06
Posts /wp-admin/edit.php3.68 ▲0.0439.98 ▼5.22
Add New Post /wp-admin/post-new.php6.91 ▼0.05151.32 ▼1,181.12
Media Library /wp-admin/upload.php3.33 ▲0.0325.05 ▲0.21
Ads for Old Posts /wp-admin/options-general.php?page=ads-for-old-posts/ads_for_old_posts.php3.3224.93

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 1 new option
New WordPress options
afop_option

Browser metrics Passed 4 tests

A check of browser resources used by Ads For Old Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,802 ▲6016.37 ▲0.748.02 ▲2.062.31 ▲0.12
Dashboard /wp-admin2,907 ▲566.75 ▲0.63122.85 ▼33.81154.96 ▼14.82
Posts /wp-admin/edit.php2,727 ▲333.30 ▲0.0668.06 ▲3.84158.76 ▲11.54
Add New Post /wp-admin/post-new.php1,692 ▲5719.97 ▲1.59390.23 ▼37.81190.12 ▲45.19
Media Library /wp-admin/upload.php1,728 ▲305.87 ▲0.32123.56 ▼30.84182.88 ▼15.54
Ads for Old Posts /wp-admin/options-general.php?page=ads-for-old-posts/ads_for_old_posts.php1,9343.4776.99143.16

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • afop_option

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/ads-for-old-posts/options_ads_for_old_posts.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-for-old-posts/ads_for_old_posts.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 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: content, posts, ads

ads-for-old-posts/ads_for_old_posts.php 92% from 13 tests

The entry point to "Ads For Old Posts" version 2.1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ads-for-old-posts.php" instead of "ads_for_old_posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected288 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP25841285
JavaScript1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin