62% awin-data-feed

Code Review | Awin Data Feed

WordPress plugin Awin Data Feed scored 62% from 54 tests.

About plugin

  • Plugin page: awin-data-feed
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.7
  • WordPress version: 5.8.1
  • First release: Apr 8, 2016
  • Latest release: Apr 18, 2021
  • Number of updates: 25
  • Update frequency: every 73.5 days
  • Top authors: digitalwindow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active / 7,534 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.47MB] [CPU: ▼183.62ms] Passed 4 tests

Server-side resources used by Awin Data Feed
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼0.7011.16 ▼23.13
Dashboard /wp-admin2.18 ▼0.8813.23 ▼31.82
Posts /wp-admin/edit.php2.18 ▼0.9212.41 ▼35.27
Add New Post /wp-admin/post-new.php2.18 ▼3.2512.72 ▼642.01
Media Library /wp-admin/upload.php2.18 ▼0.8214.46 ▼25.37
Datafeed Guide /wp-admin/admin.php?page=data-feed-guide2.1816.16
Settings /wp-admin/admin.php?page=datafeed-settings2.1813.77

Server storage [IO: ▲0.11MB] [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: 30 new files
Database: 2 new tables, 1 new option
New tables
wp_datafeed
wp_datafeed_analytics
New WordPress options
widget_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Awin Data Feed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,970 ▲37416.14 ▲0.5012.14 ▲3.4358.24 ▲7.03
Dashboard /wp-admin3,040 ▲1095.92 ▼0.06156.46 ▲11.31124.70 ▲12.15
Posts /wp-admin/edit.php2,840 ▲1012.72 ▲0.0363.36 ▼5.7499.51 ▲4.42
Add New Post /wp-admin/post-new.php1,662 ▼820.94 ▲1.78275.55 ▼120.26134.16 ▲25.97
Media Library /wp-admin/upload.php1,828 ▲215.02 ▼0.02150.81 ▲3.58111.84 ▼12.02
Datafeed Guide /wp-admin/admin.php?page=data-feed-guide1,1662.0958.1996.85
Settings /wp-admin/admin.php?page=datafeed-settings1,1442.0956.05107.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5663
    wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the awindatafeed-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=datafeed-settings
    • > User notice in wp-includes/functions.php+5663
    wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the awindatafeed-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=datafeed-settings
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the awindatafeed-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=datafeed-settings
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the awindatafeed handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/awin-data-feed/src/Datafeed/Views/Widget/widget.php
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/awin-data-feed/src/Datafeed/Models/DBAdapter.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/awin-data-feed/src/Datafeed/Views/Widget/widget.php on line 7
    • > PHP Notice
      Undefined variable: layout in wp-content/plugins/awin-data-feed/src/Datafeed/Views/Widget/widget.php on line 11
    • > PHP Notice
      Undefined variable: layout in wp-content/plugins/awin-data-feed/src/Datafeed/Views/Widget/widget.php on line 11
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/awin-data-feed/src/Datafeed/Views/Widget/widget.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/awin-data-feed/src/Datafeed/Widget.php:5
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/awin-data-feed/src/Datafeed/Views/Widget/widget.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Datafeed\\Views\\AbstractSettings' not found in wp-content/plugins/awin-data-feed/src/Datafeed/Views/SettingsMenu.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Datafeed\\DI\\Pimple' not found in wp-content/plugins/awin-data-feed/src/Datafeed/DI/PluginContainer.php:4
    • > PHP Notice
      Undefined variable: layout in wp-content/plugins/awin-data-feed/src/Datafeed/Views/Widget/widget.php on line 12

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 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: awin, affiliate window, affiliate, zanox, awin data feed...

awin-data-feed/AWDatafeed.php 85% from 13 tests

The entry point to "Awin Data Feed" version 1.5 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("awin-data-feed.php" instead of "AWDatafeed.php")

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
Everything looks great! No dangerous files found in this plugin2,230 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP162483221,285
Markdown1580281
PO File29698234
CSS1222223
JavaScript1130114
HTML11045
YAML12022
make17014
Dockerfile1337
INI1005

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods82
▷ Static methods00.00%
▷ Public methods6680.49%
▷ Protected methods00.00%
▷ Private methods1619.51%
Functions13
▷ Named functions215.38%
▷ Anonymous functions1184.62%
Constants0
▷ Global constants00.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.png1.78KB0.90KB▼ 49.29%