84% p2-header-ad

Code Review | P2 Header Ad

WordPress plugin P2 Header Ad scored84%from 54 tests.

About plugin

  • Plugin page: p2-header-ad
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.5
  • WordPress version: 6.3.1
  • First release: Oct 8, 2013
  • Latest release: May 12, 2018
  • Number of updates: 39
  • Update frequency: every 43.0 days
  • Top authors: versluis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,540 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by P2 Header Ad
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.16 ▲2.37
Dashboard /wp-admin3.34 ▼0.0045.54 ▼14.18
Posts /wp-admin/edit.php3.39 ▲0.0449.66 ▲4.16
Add New Post /wp-admin/post-new.php5.92 ▲0.0481.65 ▼25.15
Media Library /wp-admin/upload.php3.26 ▲0.0434.98 ▼0.28
P2 Header Ad /wp-admin/themes.php?page=p2-header-ad3.2334.63

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
p2HeaderAdDisplayOption
db_upgraded
widget_recent-posts
theysaidso_admin_options
p2HeaderCode
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for P2 Header Ad
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲15513.52 ▼0.858.61 ▲7.1145.98 ▲3.91
Dashboard /wp-admin2,202 ▲225.54 ▼0.0485.31 ▼2.8338.63 ▼3.79
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0534.10 ▼2.0033.75 ▼0.46
Add New Post /wp-admin/post-new.php1,529 ▲123.85 ▲0.72674.99 ▲13.2054.28 ▼3.54
Media Library /wp-admin/upload.php1,398 ▼24.16 ▼0.03104.32 ▼6.2746.34 ▼0.37
P2 Header Ad /wp-admin/themes.php?page=p2-header-ad9172.1623.4132.07

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/p2-header-ad/p2-header-ad.php:36

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 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes: The official readme.txt might help

p2-header-ad/p2-header-ad.php Passed 13 tests

This is the main PHP file of "P2 Header Ad" version 1.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
53 characters long description:
inserts a block of ad code into the P2 Theme's Header

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
Good job! No executable or dangerous file extensions detected357 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP269105204
PO File24046142
CSS1327
JavaScript16114

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Header-Advert.png5.77KB2.02KB▼ 65.02%
images/guru-header-2013.png33.72KB13.19KB▼ 60.90%