89% purpleads-ads-txt-manager

Code Review | PurpleAds Ads.txt Manager

WordPress plugin PurpleAds Ads.txt Manager scored 89% from 54 tests.

About plugin

  • Plugin page: purpleads-ads-txt...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 6, 2023
  • Latest release: Aug 15, 2023
  • Number of updates: 5
  • Update frequency: every 14.0 days
  • Top authors: purpleads (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 204 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.02MB] [CPU: ▼2.76ms] Passed 4 tests

An overview of server-side resources used by PurpleAds Ads.txt Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.30 ▼0.94
Dashboard /wp-admin3.32 ▲0.0251.24 ▼7.04
Posts /wp-admin/edit.php3.37 ▲0.0259.08 ▲8.53
Add New Post /wp-admin/post-new.php5.90 ▲0.02100.37 ▲1.27
Media Library /wp-admin/upload.php3.25 ▲0.0236.37 ▼4.31

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

PurpleAds Ads.txt Manager: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲913.11 ▼0.521.65 ▼0.4145.67 ▼0.26
Dashboard /wp-admin2,229 ▲234.91 ▲0.0698.39 ▼14.8541.04 ▼1.41
Posts /wp-admin/edit.php2,109 ▲201.99 ▼0.0241.56 ▲6.3736.01 ▼2.08
Add New Post /wp-admin/post-new.php1,531 ▲1223.14 ▼0.13676.37 ▲47.2256.19 ▲2.45
Media Library /wp-admin/upload.php1,408 ▲234.18 ▼0.0395.97 ▼1.7745.58 ▲2.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: publishers, adstxt, advertising, ad network

purpleads-ads-txt-manager/purpleads.php 85% from 13 tests

Analyzing the main PHP file in "PurpleAds Ads.txt Manager" version 1.0.1
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("purpleads-ads-txt-manager.php" instead of "purpleads.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin95 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP19972
CSS11122
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.55MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png15.83KB6.33KB▼ 60.00%
assets/icon-1200.png41.78KB17.11KB▼ 59.04%
assets/banner-sm.png21.60KB7.93KB▼ 63.28%
assets/icon-128x128.png8.96KB3.67KB▼ 59.02%
assets/icon-128.png8.96KB3.67KB▼ 59.02%