83% smartarget-corner-ribbon

Code Review | Smartarget Corner Ribbon

WordPress plugin Smartarget Corner Ribbon scored 83% from 54 tests.

About plugin

  • Plugin page: smartarget-corner...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 5.9.2
  • First release: Aug 26, 2021
  • Latest release: Mar 14, 2022
  • Number of updates: 5
  • Update frequency: every 40.0 days
  • Top authors: erezs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 245 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼303.85ms] Passed 4 tests

A check of server-side resources used by Smartarget Corner Ribbon
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0258.82 ▲6.48
Dashboard /wp-admin3.43 ▲0.0338.54 ▲2.17
Posts /wp-admin/edit.php3.66 ▲0.0239.30 ▼2.29
Add New Post /wp-admin/post-new.php6.91 ▼0.0698.35 ▼1,213.93
Media Library /wp-admin/upload.php3.31 ▲0.0125.92 ▼1.35
Smartarget Corner Ribbon /wp-admin/options-general.php?page=smartarget_corner_ribbon3.3123.68

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Smartarget Corner Ribbon
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,996 ▲27423.86 ▲7.9211.11 ▲4.432.02 ▼0.38
Dashboard /wp-admin2,999 ▲13814.99 ▲8.80291.48 ▲159.92194.47 ▲32.85
Posts /wp-admin/edit.php2,783 ▲9811.73 ▲8.50222.09 ▲161.43138.68 ▲1.09
Add New Post /wp-admin/post-new.php1,777 ▲11627.58 ▲10.48594.49 ▲181.38159.50 ▲4.74
Media Library /wp-admin/upload.php1,787 ▲8913.11 ▲7.61305.58 ▲163.46191.54 ▲0.85
Smartarget Corner Ribbon /wp-admin/options-general.php?page=smartarget_corner_ribbon1,51012.05238.71177.16

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/smartarget-corner-ribbon/public/partials/smartarget-corner-ribbon-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/smartarget-corner-ribbon/admin/partials/smartarget-corner-ribbon-admin-display.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=smartarget_corner_ribbon
    • > Network (severe)
    wp-admin/websites-websites-module.js - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=smartarget_corner_ribbon
    • > Console-api (severe) in unknown
    /wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023 593:187 "ERROR" Error: Uncaught (in promise): ChunkLoadError: Loading chunk 14 failed.(error: /wp-admin/websites-websites-module.js)ChunkLoadError: Loading chunk 14 failed.(error: /wp-admin/websites-websites-module.js)at Function.i.e (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:325:173858)at loadChildren (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:1442:61141)at e.value (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:1427:591)at e.value (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:1427:296)at n.project (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:1353:5950)at n.value (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:397:1530)at n.value (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:397:1430)at n.value (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:397:3825)at e._subscribe (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:1135:7457)at e.value (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:397:289822)at E (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:21:1921)at E (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:21:1445)at /wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:21:2721at t.invokeTask (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:13:7853)at Object.onInvokeTask (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:1068:1778)at t.invokeTask (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:13:7774)at e.runTask (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:13:2932)at b (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:13:10169)at e.invokeTask [as invoke] (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:13:9014)at p (/wp-content/plugins/smartarget-corner-ribbon/admin/js/package.js?ver=74023:44:734)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: advertisement, corner ribbon, smartarget, corner, prompte...

smartarget-corner-ribbon/smartarget-corner-ribbon.php 92% from 13 tests

This is the main PHP file of "Smartarget Corner Ribbon" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected864 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript654,369642
PHP12133544221
CSS2041

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin