78% simple-dfp

Code Review | Simple GAM

WordPress plugin Simple GAM scored 78% from 54 tests.

About plugin

  • Plugin page: simple-dfp
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 5.8.1
  • First release: Apr 19, 2017
  • Latest release: Feb 17, 2020
  • Number of updates: 39
  • Update frequency: every 26.5 days
  • Top authors: munger41 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,028 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼150.39ms] Passed 4 tests

Server-side resources used by Simple GAM
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.35 ▲0.6331.40 ▲10.24
Dashboard /wp-admin3.73 ▲0.6854.19 ▲8.31
Posts /wp-admin/edit.php3.78 ▲0.6749.85 ▲6.46
Add New Post /wp-admin/post-new.php4.65 ▼0.7848.34 ▼609.24
Media Library /wp-admin/upload.php3.61 ▲0.6136.28 ▼7.09
All Simple GAM Ads /wp-admin/edit.php?post_type=simpledfp_ad3.7238.32
Add New /wp-admin/post-new.php?post_type=simpledfp_ad3.5537.73
Simple GAM /wp-admin/options-general.php?page=simplegam-setting-admin3.5626.31

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 87 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple GAM
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,856 ▲26016.21 ▲0.7211.07 ▲2.7852.36 ▲5.26
Dashboard /wp-admin3,010 ▲765.94 ▲0.01137.28 ▼17.42113.39 ▲5.04
Posts /wp-admin/edit.php2,779 ▲402.70 ▲0.0264.95 ▼1.6795.32 ▲7.06
Add New Post /wp-admin/post-new.php1,709 ▲3918.81 ▼0.42375.44 ▼15.89107.98 ▼6.81
Media Library /wp-admin/upload.php1,847 ▲405.00 ▼0.01146.17 ▼3.55121.14 ▼5.73
All Simple GAM Ads /wp-admin/edit.php?post_type=simpledfp_ad1,4842.6261.2677.08
Add New /wp-admin/post-new.php?post_type=simpledfp_ad3,4139.10217.11154.91
Simple GAM /wp-admin/options-general.php?page=simplegam-setting-admin9592.1135.0478.87

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=simpledfp_ad
    • > Notice in wp-content/plugins/simple-dfp/simple-dfp.php+357
    Undefined index: blockmeta_noncename
    • > GET request to /wp-admin/post-new.php?post_type=simpledfp_ad
    • > Notice in wp-content/plugins/simple-dfp/simple-dfp.php+309
    Undefined index: sizemeta_noncename
    • > GET request to /wp-admin/options-general.php?page=simplegam-setting-admin
    • > Notice in wp-content/plugins/simple-dfp/SettingsPage.php+334
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=simplegam-setting-admin
    • > Error in wp-content/plugins/simple-dfp/SettingsPage.php+399
    Uncaught Error: Call to undefined function SimpleGAM\InDesignHTML2Post_log() in wp-content/plugins/simple-dfp/SettingsPage.php:399
    Stack trace:
    #0 wp-admin/includes/template.php(1743): SimpleGAM\SimpleGAM_SettingsPage->gam_keys_callback()
    #1 wp-admin/includes/template.php(1701): do_settings_fields()
    #2 wp-content/plugins/simple-dfp/SettingsPage.php(182): do_settings_sections()
    #3 wp-includes/class-wp-hook.php(303): SimpleGAM\SimpleGAM_SettingsPage->create_admin_page()
    #4 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(470): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #8 {main}
    thrown

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
Please fix the following items
  • 57× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'LoggerRenderer' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/renderers/LoggerRendererDefault.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'LoggerConfigurationAdapter' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/configurators/LoggerConfigurationAdapterINI.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerAppender' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/appenders/LoggerAppenderFirePHP.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerPatternConverter' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/pattern/LoggerPatternConverterLiteral.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerPatternConverter' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/pattern/LoggerPatternConverterLine.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerPatternConverter' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/pattern/LoggerPatternConverterMessage.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerPatternConverterSuperglobal' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/pattern/LoggerPatternConverterServer.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerFilter' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/filters/LoggerFilterLevelMatch.php:48
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerAppender' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/appenders/LoggerAppenderPDO.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerLayout' not found in wp-content/plugins/simple-dfp/libs/log4php/2.3.0/layouts/LoggerLayoutPattern.php:33

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Network settings) image missing
You can look at the official readme.txt

simple-dfp/simple-dfp.php Passed 13 tests

"Simple GAM" version 1.3.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
82 characters long description:
Finally an easy plugin to add GAM blocks into WP - shortcode and template function

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected4,620 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
PHP811,2745,4434,547
DTD1255469
JavaScript1404

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.22
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces3
Traits0
Classes78
▷ Abstract classes67.69%
▷ Concrete classes7292.31%
▷ Final classes00.00%
Methods508
▷ Static methods5611.02%
▷ Public methods43585.63%
▷ Protected methods234.53%
▷ Private methods509.84%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants46
▷ Global constants00.00%
▷ Class constants46100.00%
▷ Public constants46100.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
No PNG images were found in this plugin