84% ads-by-datafeedrcom

Code Review | Ads by datafeedr.com

WordPress plugin Ads by datafeedr.com scored84%from 54 tests.

About plugin

  • Plugin page: ads-by-datafeedrcom
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.7
  • WordPress version: 6.3.1
  • First release: Mar 17, 2013
  • Latest release: Mar 8, 2021
  • Number of updates: 79
  • Update frequency: every 36.9 days
  • Top authors: datafeedr.com (100%)

Code review

54 tests

User reviews

32 reviews

Install metrics

5,000+ active /104,146 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.86ms] Passed 4 tests

A check of server-side resources used by Ads by datafeedr.com
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.58 ▲3.61
Dashboard /wp-admin3.36 ▲0.0646.37 ▼14.12
Posts /wp-admin/edit.php3.42 ▲0.0653.43 ▲0.19
Add New Post /wp-admin/post-new.php5.95 ▲0.0693.73 ▲0.17
Media Library /wp-admin/upload.php3.29 ▲0.0634.78 ▼1.66
All Ads /wp-admin/edit.php?post_type=dfads3.5950.94
Add New Ad /wp-admin/post-new.php?post_type=dfads3.8958.12
Ads /wp-admin/options-general.php?page=dfads-settings3.3535.05
Groups /wp-admin/edit-tags.php?taxonomy=dfads_group&post_type=dfads3.2837.11

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 377 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
dfads_transient_data_deleted_time
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Ads by datafeedr.com: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲14413.40 ▼0.968.73 ▲6.6444.29 ▲0.10
Dashboard /wp-admin2,217 ▲405.58 ▼0.1287.95 ▼0.9766.55 ▲23.53
Posts /wp-admin/edit.php2,140 ▲401.97 ▼0.0653.74 ▲15.0438.78 ▼2.84
Add New Post /wp-admin/post-new.php1,580 ▲5418.29 ▼4.78631.45 ▼51.6355.73 ▼7.65
Media Library /wp-admin/upload.php1,431 ▲314.13 ▼0.16115.88 ▲3.3499.00 ▲50.15
All Ads /wp-admin/edit.php?post_type=dfads1,2442.0939.2133.13
Add New Ad /wp-admin/post-new.php?post_type=dfads2,3054.4485.58125.09
Ads /wp-admin/options-general.php?page=dfads-settings1,2322.2530.3630.23
Groups /wp-admin/edit-tags.php?taxonomy=dfads_group&post_type=dfads1,3112.1226.5932.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • dfads_transient_data_deleted_time
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 44× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ads-by-datafeedrcom/lib/metabox/example-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/ads-by-datafeedrcom/inc/admin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_dropdown_categories() in wp-content/plugins/ads-by-datafeedrcom/inc/generator.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_hookup' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/CMB2_Options_Hookup.php:14

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: advertising, banner ads, random ads, datafeedr, rotating ads...

ads-by-datafeedrcom/dfads.php 85% from 13 tests

The principal PHP file in "Ads by datafeedr.com" v. 1.1.3 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ads-by-datafeedrcom.php" instead of "dfads.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 183 characters long)

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
There were no executable files found in this plugin47,589 lines of code in 207 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP612,2216,1237,894
CSS141,1881,1645,103
JavaScript93726251,534
Markdown32370735

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity20.12
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity93.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes72
▷ Abstract classes811.11%
▷ Concrete classes6488.89%
▷ Final classes00.00%
Methods565
▷ Static methods8815.58%
▷ Public methods47483.89%
▷ Protected methods8815.58%
▷ Private methods30.53%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants1164.71%
▷ Class constants635.29%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
31 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
lib/metabox/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
lib/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
lib/metabox/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
lib/metabox/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%