83% ads-after-first-paragraph

Code Review | Ads after first paragraph

WordPress plugin Ads after first paragraph scored 83% from 54 tests.

About plugin

  • Plugin page: ads-after-first-p...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.1-4.8.1
  • WordPress version: 5.9.2
  • First release: Feb 27, 2017
  • Latest release: Sep 12, 2017
  • Number of updates: 29
  • Update frequency: every 6.7 days
  • Top authors: ifourkuldeep1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,037 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼300.74ms] Passed 4 tests

This is a short check of server-side resources used by Ads after first paragraph
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0758.86 ▲4.77
Dashboard /wp-admin3.47 ▲0.0538.28 ▼0.35
Posts /wp-admin/edit.php3.69 ▲0.0543.71 ▲2.14
Add New Post /wp-admin/post-new.php6.93 ▼0.0497.62 ▼1,201.82
Media Library /wp-admin/upload.php3.34 ▲0.0425.55 ▼2.94

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Ads after first paragraph
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲4915.69 ▼0.066.03 ▲0.092.92 ▲0.57
Dashboard /wp-admin2,905 ▲446.15 ▼0.03123.43 ▼17.28175.23 ▲10.26
Posts /wp-admin/edit.php2,704 ▲163.14 ▼0.1063.14 ▼3.14143.63 ▼3.47
Add New Post /wp-admin/post-new.php1,674 ▲616.60 ▼1.81421.77 ▲11.98193.80 ▲34.88
Media Library /wp-admin/upload.php1,714 ▲165.47 ▼0.07126.41 ▼15.11205.30 ▲24.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+307
    Non-static method Ads_after_first_paragraph::fiAdd_deactivation_hook() should not be called statically

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ads-after-first-paragraph/frontend-add.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (29 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add an image for screenshot #1 (Post with advt. after first paragraph and sticky ads in sidebars)
The official readme.txt is a good inspiration

ads-after-first-paragraph/ads-first-paragraph.php 85% from 13 tests

The main PHP file in "Ads after first paragraph" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 165 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ads-after-first-paragraph.php" instead of "ads-first-paragraph.php")

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
Success! There were no dangerous files found in this plugin219 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33492179
CSS1134540

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 0.56MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png65.21KB18.21KB▼ 72.07%
(invalid) assets/images/fiAdd_icon2.png1.49KB0.00KB▼ 100.00%
assets/screenshot-2.png93.19KB35.81KB▼ 61.57%
assets/banner-772x250.png45.95KB16.22KB▼ 64.69%
(invalid) assets/images/icon-128x128.png6.34KB0.00KB▼ 100.00%