90% snack-ads

Code Review | Snack Ads

WordPress plugin Snack Ads scored90%from 54 tests.

About plugin

  • Plugin page: snack-ads
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Jan 31, 2022
  • Latest release: Aug 22, 2023
  • Number of updates: 8
  • Update frequency: every 71.4 days
  • Top authors: bouk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /663 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.80ms] Passed 4 tests

Server-side resources used by Snack Ads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1143.20 ▲0.28
Dashboard /wp-admin3.40 ▲0.1058.35 ▲3.99
Posts /wp-admin/edit.php3.52 ▲0.1651.83 ▼1.75
Add New Post /wp-admin/post-new.php5.99 ▲0.1088.65 ▼14.05
Media Library /wp-admin/upload.php3.32 ▲0.0937.93 ▲0.33

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Snack Ads
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲4313.21 ▼1.551.81 ▼0.2244.26 ▲1.12
Dashboard /wp-admin2,217 ▲295.77 ▼0.0597.99 ▼13.1838.29 ▼4.92
Posts /wp-admin/edit.php2,103 ▲111.99 ▼0.0638.26 ▼2.2733.65 ▼3.65
Add New Post /wp-admin/post-new.php1,523 ▼1917.58 ▼0.59683.89 ▲8.0459.73 ▼1.58
Media Library /wp-admin/upload.php1,399 ▲114.24 ▲0.0396.64 ▼16.1842.68 ▼6.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
You can look at the official readme.txt

snack-ads/snack-ads.php Passed 13 tests

The principal PHP file in "Snack Ads" v. 2.1.1 is loaded by WordPress automatically on each request
70 characters long description:
Allows to display Ad units managed by Snack Media Ad Ops team remotely

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected819 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP14213550814
JSON1005

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity15.25
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods60
▷ Static methods1931.67%
▷ Public methods5795.00%
▷ Protected methods00.00%
▷ Private methods35.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin