84% addefend-easy-integration

Code Review | AdDefend Easy Integration

WordPress plugin AdDefend Easy Integration scored 84% from 54 tests.

About plugin

  • Plugin page: addefend-easy-int...
  • Plugin version: 1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.9
  • WordPress version: 5.9.2
  • First release: May 12, 2017
  • Latest release: Mar 11, 2022
  • Number of updates: 51
  • Update frequency: every 34.6 days
  • Top authors: melkarim (98.04%)danielnikolov (3.92%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,415 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼326.40ms] Passed 4 tests

Analyzing server-side resources used by AdDefend Easy Integration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.2661.80 ▲8.45
Dashboard /wp-admin3.50 ▲0.0935.80 ▼58.25
Posts /wp-admin/edit.php3.74 ▲0.0944.72 ▼48.64
Add New Post /wp-admin/post-new.php6.97 ▼0.0094.14 ▼1,163.52
Media Library /wp-admin/upload.php3.39 ▲0.0926.68 ▼35.17
AdDefend integration /wp-admin/options-general.php?page=AdDefend3.3628.66

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: 1 new table, no new options
New tables
wp_addefend

Browser metrics Passed 4 tests

A check of browser resources used by AdDefend Easy Integration
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4615.88 ▲0.245.61 ▼0.223.03 ▲0.78
Dashboard /wp-admin2,891 ▲376.10 ▼0.08127.09 ▼21.56210.80 ▲37.46
Posts /wp-admin/edit.php2,693 ▲23.24 ▲0.0061.14 ▼4.83142.71 ▼7.97
Add New Post /wp-admin/post-new.php1,713 ▲2320.75 ▲0.18457.02 ▲1.60198.25 ▲31.83
Media Library /wp-admin/upload.php1,703 ▲55.55 ▲0.01169.37 ▲27.22214.11 ▲15.59
AdDefend integration /wp-admin/options-general.php?page=AdDefend1,2952.5657.27130.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_addefend

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

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
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/addefend-easy-integration/Components/proxy_integration.php:3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/addefend-easy-integration/Components/script_integration.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/addefend-easy-integration/Components/script_integration.php on line 6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/addefend-easy-integration/Components/script_integration.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/addefend-easy-integration/Components/proxy_internal_forwarding.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/addefend-easy-integration/View/options.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/addefend-easy-integration/Components/script_integration.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/addefend-easy-integration/addefend-easy-integration.php:26

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt is a good inspiration

addefend-easy-integration/addefend-easy-integration.php 92% from 13 tests

The main PHP script in "AdDefend Easy Integration" version 1.12 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected741 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP74736663
SVG11178

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png4.79KB2.53KB▼ 47.07%