89% advanced-ads-genesis

Code Review | Ads for Genesis

WordPress plugin Ads for Genesis scored 89% from 54 tests.

About plugin

  • Plugin page: advanced-ads-genesis
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.2
  • WordPress version: 6.3.1
  • First release: May 4, 2016
  • Latest release: Apr 3, 2023
  • Number of updates: 32
  • Update frequency: every 78.9 days
  • Top authors: webzunft (81.25%)advancedads (21.88%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 23,547 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

This is a short check of server-side resources used by Ads for Genesis
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.29 ▲2.22
Dashboard /wp-admin3.34 ▲0.0445.54 ▼6.79
Posts /wp-admin/edit.php3.39 ▲0.0445.16 ▼0.98
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.39 ▼4.99
Media Library /wp-admin/upload.php3.26 ▲0.0434.26 ▼0.28

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Ads for Genesis
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.27 ▼0.931.77 ▼0.2143.13 ▼5.35
Dashboard /wp-admin2,218 ▲325.90 ▲0.99101.39 ▼9.1139.16 ▼1.29
Posts /wp-admin/edit.php2,100 ▲112.06 ▲0.0235.71 ▼1.6234.13 ▲1.54
Add New Post /wp-admin/post-new.php1,554 ▲2523.41 ▲5.29593.06 ▼17.6560.64 ▲8.54
Media Library /wp-admin/upload.php1,403 ▲124.28 ▲0.03101.02 ▼1.0144.22 ▲1.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

advanced-ads-genesis/genesis-ads.php 92% from 13 tests

The main file in "Ads for Genesis" v. 1.0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-ads-genesis.php" instead of "genesis-ads.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin292 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP455130218
PO File1181874

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.00
▷ Minimum class complexity4.00
▷ Maximum class complexity11.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/genesis.png6.57KB3.18KB▼ 51.56%