84% ads-by-datafeedrcom

Code Review | Ads by datafeedr.com

WordPress plugin Ads by datafeedr.com scored 84% 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: 5.9.2
  • 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

31 reviews

Install metrics

6,000+ active / 100,557 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.15MB] [CPU: ▼307.41ms] Passed 4 tests

This is a short 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.69 ▲0.1856.22 ▲6.55
Dashboard /wp-admin3.59 ▲0.1833.92 ▲1.05
Posts /wp-admin/edit.php3.81 ▲0.1738.84 ▼4.92
Add New Post /wp-admin/post-new.php7.06 ▲0.0996.42 ▼1,223.59
Media Library /wp-admin/upload.php3.47 ▲0.1725.43 ▼2.19
Groups /wp-admin/edit-tags.php?taxonomy=dfads_group&post_type=dfads3.4725.39
Ads /wp-admin/options-general.php?page=dfads-settings4.0628.27
Add New Ad /wp-admin/post-new.php?post_type=dfads4.6951.08
All Ads /wp-admin/edit.php?post_type=dfads4.2038.55

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 377 new files
Database: no new tables, 1 new option
New WordPress options
dfads_transient_data_deleted_time

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ads by datafeedr.com
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,951 ▲19716.15 ▲0.408.70 ▲2.172.95 ▲0.18
Dashboard /wp-admin2,937 ▲796.13 ▼0.02122.42 ▼14.47169.78 ▲10.83
Posts /wp-admin/edit.php2,730 ▲423.14 ▼0.0965.84 ▼0.08144.19 ▲4.01
Add New Post /wp-admin/post-new.php1,690 ▲2922.01 ▲5.13438.95 ▼0.37169.80 ▲16.94
Media Library /wp-admin/upload.php1,746 ▲485.74 ▲0.23123.50 ▼14.92215.86 ▲25.71
Groups /wp-admin/edit-tags.php?taxonomy=dfads_group&post_type=dfads1,6692.5956.14114.04
Ads /wp-admin/options-general.php?page=dfads-settings1,6002.7558.20146.68
Add New Ad /wp-admin/post-new.php?post_type=dfads3,1086.41122.67240.99
All Ads /wp-admin/edit.php?post_type=dfads1,5333.1266.10121.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • dfads_transient_data_deleted_time

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 44× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_Text_Date.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_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/init.php:126
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.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_Colorpicker.php:13
    • > 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_REST_Controller_Boxes' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > 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_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/ads-by-datafeedrcom/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: advertising, rotating ads, ads, google adsense, random 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
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 183 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("ads-by-datafeedrcom.php" instead of "dfads.php")

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
Success! There were no dangerous 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

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
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_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
lib/metabox/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
img/datafeedr-menu-icon.png0.43KB0.30KB▼ 29.09%
lib/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
lib/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%