84% sourceknowledge-shopping-ads

Code Review | SourceKnowledge Shopping Ads

WordPress plugin SourceKnowledge Shopping Ads scored84%from 54 tests.

About plugin

  • Plugin page: sourceknowledge-s...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: Apr 3, 2020
  • Latest release: Jul 14, 2021
  • Number of updates: 20
  • Update frequency: every 23.5 days
  • Top authors: soknodev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,089 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by SourceKnowledge Shopping Ads
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0341.89 ▼2.27
Dashboard /wp-admin3.34 ▼0.0150.44 ▼18.97
Posts /wp-admin/edit.php3.39 ▲0.0352.89 ▼3.47
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.57 ▼11.50
Media Library /wp-admin/upload.php3.26 ▲0.0336.35 ▲2.51

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
sourceknowledge_config_needs_revision
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for SourceKnowledge Shopping Ads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.28 ▼0.041.52 ▼0.1841.40 ▼3.60
Dashboard /wp-admin2,198 ▲215.63 ▼0.0292.15 ▼5.0942.59 ▲0.05
Posts /wp-admin/edit.php2,103 ▲62.00 ▼0.0239.26 ▼0.5534.25 ▼4.54
Add New Post /wp-admin/post-new.php1,526 ▼022.96 ▼0.78617.63 ▼92.2954.21 ▼4.16
Media Library /wp-admin/upload.php1,403 ▼04.21 ▲0.0496.39 ▼7.2040.91 ▼2.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/sourceknowledge-shopping-ads/admin/partials/sokno-shopping-ads-admin-display.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/sourceknowledge-shopping-ads/includes/class-sokno-shopping-ads-integration.php:22
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sourceknowledge-shopping-ads/admin/partials/sokno-shopping-ads-admin-display.php on line 16
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/sourceknowledge-shopping-ads/admin/partials/sokno-shopping-ads-admin-display.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sourceknowledge-shopping-ads/admin/partials/sokno-shopping-ads-admin-notification.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% 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
10 plugin tags: sourceknowledge, sell, checkout, cart, shop...

sourceknowledge-shopping-ads/sourceknowledge-shopping-ads.php 92% from 13 tests

The main PHP file in "SourceKnowledge Shopping Ads" ver. 1.0.8 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "3.0")

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
No dangerous file extensions were detected1,018 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP163021,354978
JavaScript271940

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.17
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods95
▷ Static methods3132.63%
▷ Public methods6972.63%
▷ Protected methods00.00%
▷ Private methods2627.37%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants44
▷ Global constants12.27%
▷ Class constants4397.73%
▷ Public constants43100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin