84% dfp-ads

Code Review | DFP Ad Manager

WordPress plugin DFP Ad Manager scored 84% from 54 tests.

About plugin

  • Plugin page: dfp-ads
  • Plugin version: 0.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.2.2
  • WordPress version: 5.8.1
  • First release: May 13, 2015
  • Latest release: Aug 19, 2015
  • Number of updates: 26
  • Update frequency: every 3.8 days
  • Top authors: chriswgerber (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active / 9,918 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼143.98ms] Passed 4 tests

A check of server-side resources used by DFP Ad Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1736.20 ▲6.98
Dashboard /wp-admin3.15 ▲0.0968.62 ▲14.67
Posts /wp-admin/edit.php3.26 ▼0.3444.80 ▼3.54
Add New Post /wp-admin/post-new.php5.51 ▲0.0889.74 ▼587.24
Media Library /wp-admin/upload.php3.09 ▲0.0845.99 ▲7.88
All Ad Positions /wp-admin/edit.php?post_type=dfp_ads3.1330.96
Settings /wp-admin/edit.php?post_type=dfp_ads&page=settings3.0630.77
Add New /wp-admin/post-new.php?post_type=dfp_ads3.3043.46
Import /wp-admin/edit.php?post_type=dfp_ads&page=import3.0635.97

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 147 new files
Database: no new tables, 1 new option
New WordPress options
widget_dfp-ad-widget

Browser metrics Passed 4 tests

Checking browser requirements for DFP Ad Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,867 ▲26118.05 ▲2.4636.61 ▲28.1054.67 ▲5.99
Dashboard /wp-admin3,011 ▲805.93 ▼0.04166.64 ▲19.96119.67 ▲9.30
Posts /wp-admin/edit.php2,780 ▲412.70 ▲0.0264.26 ▼1.8792.88 ▲5.56
Add New Post /wp-admin/post-new.php1,709 ▲3717.75 ▼1.33388.07 ▲7.07114.91 ▲4.14
Media Library /wp-admin/upload.php1,848 ▲415.04 ▲0.04151.39 ▼12.50144.99 ▲13.42
All Ad Positions /wp-admin/edit.php?post_type=dfp_ads1,4452.6260.9475.61
Settings /wp-admin/edit.php?post_type=dfp_ads&page=settings1,1172.1058.4784.44
Add New /wp-admin/post-new.php?post_type=dfp_ads2,1063.28115.6094.52
Import /wp-admin/edit.php?post_type=dfp_ads&page=import1,1082.1161.4786.97

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
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_dfp-ad-widget

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 85× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/tests/Ddeboer/DataImport/Tests/Filter/ValidationFilterTest.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Ddeboer\\DataImport\\Filter\\FilterInterface' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/src/Ddeboer/DataImport/Filter/ValidatorFilter.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/tests/Ddeboer/DataImport/Tests/ItemConverter/MappingItemConverterTest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Ddeboer\\DataImport\\Filter\\FilterInterface' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/src/Ddeboer/DataImport/Filter/CallbackFilter.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/tests/Ddeboer/DataImport/Tests/ValueConverter/ObjectConverterTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Ddeboer\\DataImport\\Writer\\AbstractWriter' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/src/Ddeboer/DataImport/Writer/DoctrineWriter.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/tests/Ddeboer/DataImport/Tests/Writer/ConsoleTableWriterTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/tests/Ddeboer/DataImport/Tests/WorkflowTest.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Ddeboer\\DataImport\\Exception\\ExceptionInterface' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/src/Ddeboer/DataImport/Exception/WriterException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/dfp-ads/vendor/ddeboer/data-import/tests/Ddeboer/DataImport/Tests/Reader/OneToManyReaderTest.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: doubleclick, dfp, ad trafficking, ads, ad ops

dfp-ads/plugin.php 92% from 13 tests

The primary PHP file in "DFP Ad Manager" version 0.3.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dfp-ads.php" instead of "plugin.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
Everything looks great! No dangerous files found in this plugin7,330 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
PHP1201,5163,4686,087
Markdown23390984
JSON300193
JavaScript443150
XML12016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity3.77
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces21
Interfaces9
Traits2
Classes104
▷ Abstract classes65.77%
▷ Concrete classes9894.23%
▷ Final classes00.00%
Methods547
▷ Static methods61.10%
▷ Public methods49991.22%
▷ Protected methods386.95%
▷ Private methods101.83%
Functions44
▷ Named functions1431.82%
▷ Anonymous functions3068.18%
Constants12
▷ Global constants18.33%
▷ Class constants1191.67%
▷ Public constants11100.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
There are no PNG files in this plugin