73% ads-after-first-paragraph

Code Review | Ads after first paragraph

WordPress plugin Ads after first paragraph scored73%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: 6.3.1
  • 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,246 total downloads

Benchmarks

Plugin footprint 65% 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.04MB] [CPU: ▼5.07ms] Passed 4 tests

An overview of server-side resources used by Ads after first paragraph
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.87 ▼4.75
Dashboard /wp-admin3.35 ▲0.0546.20 ▼3.26
Posts /wp-admin/edit.php3.40 ▲0.0546.60 ▼1.88
Add New Post /wp-admin/post-new.php5.93 ▲0.0583.68 ▼10.39
Media Library /wp-admin/upload.php3.27 ▲0.0540.31 ▲6.30

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Ads after first paragraph
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲8213.19 ▼1.504.60 ▲2.6943.16 ▼9.86
Dashboard /wp-admin2,221 ▲334.96 ▲0.0798.53 ▼15.7776.57 ▲30.10
Posts /wp-admin/edit.php2,104 ▲122.02 ▼0.0335.76 ▼3.6531.50 ▼2.94
Add New Post /wp-admin/post-new.php1,680 ▲14722.02 ▼1.16770.82 ▲93.6651.19 ▼1.74
Media Library /wp-admin/upload.php1,403 ▲154.21 ▼0.0993.89 ▼5.6284.08 ▲40.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Ads_after_first_paragraph::fiAdd_deactivation_hook() should not be called statically
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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)
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 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 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: You are using too many tags: 29 tag instead of maximum 10
  • Screenshots: Screenshot #1 (Post with advt. after first paragraph and sticky ads in sidebars) image not found
You can take inspiration from this readme.txt

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

The primary PHP file in "Ads after first paragraph" version 1.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • 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")
  • Description: Keep the plugin description shorter than 140 characters (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! 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

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
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

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.56MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/images/fiAdd_icon.png0.84KB0.00KB▼ 100.00%
assets/screenshot-3.png65.21KB18.21KB▼ 72.07%
(invalid) assets/icon-128x128.png6.34KB0.00KB▼ 100.00%
(invalid) assets/images/icon-256x256.png13.68KB0.00KB▼ 100.00%
assets/banner-772x250.png45.95KB16.22KB▼ 64.69%