89% consentforads

Code Review | ConsentForAds

WordPress plugin ConsentForAds scored89%from 54 tests.

About plugin

  • Plugin page: consentforads
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 6.3.1
  • First release: May 25, 2018
  • Latest release: May 25, 2018
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: dmartuszewskium (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,145 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: ▼1.09ms] Passed 4 tests

Server-side resources used by ConsentForAds
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.53 ▼1.96
Dashboard /wp-admin3.34 ▲0.0346.96 ▲2.53
Posts /wp-admin/edit.php3.45 ▲0.0948.53 ▲3.05
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.62 ▼7.96
Media Library /wp-admin/upload.php3.26 ▲0.0335.61 ▲3.94

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
consent_for_ads_version
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for ConsentForAds
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.17 ▼1.211.77 ▲0.1341.73 ▲1.69
Dashboard /wp-admin2,223 ▲355.84 ▲0.92105.15 ▲4.7176.37 ▲32.57
Posts /wp-admin/edit.php2,116 ▲271.98 ▲0.0138.73 ▼4.1538.02 ▲2.57
Add New Post /wp-admin/post-new.php1,548 ▲518.23 ▲0.23714.59 ▲104.5453.91 ▼5.68
Media Library /wp-admin/upload.php1,405 ▲204.13 ▼0.08101.97 ▼2.6773.99 ▲27.40

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: gdpr, unveilmedia, consent, tool, advertising

consentforads/consent-for-ads.php 85% from 13 tests

The entry point to "ConsentForAds" version 1.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("consentforads.php" instead of "consent-for-ads.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin203 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP27437171
CSS10832

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity5.67
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods1280.00%
▷ Protected methods320.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo-admin.png1.56KB1.54KB▼ 1.06%
img/um-avatar.png1.33KB0.95KB▼ 28.85%