78% ucard

Code Review | Ucard

WordPress plugin Ucard scored78%from 54 tests.

About plugin

  • Plugin page: ucard
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.5
  • WordPress version: 6.3.1
  • First release: Sep 5, 2020
  • Latest release: Sep 13, 2020
  • Number of updates: 3
  • Update frequency: every 3.0 days
  • Top authors: anwerashif (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /438 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.02MB] [CPU: ▼3.88ms] Passed 4 tests

An overview of server-side resources used by Ucard
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.87 ▲4.46
Dashboard /wp-admin3.34 ▲0.0353.90 ▲3.05
Posts /wp-admin/edit.php3.39 ▲0.0247.13 ▼4.25
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.15 ▼11.62
Media Library /wp-admin/upload.php3.26 ▲0.0234.45 ▼2.68
Ucard /wp-admin/admin.php?page=genesis-uicard3.2933.47

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Ucard
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲11113.80 ▼0.478.81 ▲7.2440.70 ▼2.60
Dashboard /wp-admin2,195 ▲215.51 ▼0.1798.31 ▼19.6942.32 ▼3.74
Posts /wp-admin/edit.php2,103 ▲61.97 ▼0.0235.06 ▼2.4533.46 ▼0.10
Add New Post /wp-admin/post-new.php1,526 ▼223.72 ▲0.49637.20 ▼32.1462.66 ▲10.59
Media Library /wp-admin/upload.php1,403 ▼04.21 ▲0.0095.53 ▼9.1044.89 ▼3.87
Ucard /wp-admin/admin.php?page=genesis-uicard1,3541.6525.9228.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=genesis-uicard
    • > Notice in wp-content/plugins/ucard/admin/panel.php+141
    Trying to access array offset on value of type bool

SRP 50% 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
Please take a closer look at the following
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ucard/admin/office.php:9
    • > PHP Warning
      Use of undefined constant ucard_inc - assumed 'ucard_inc' (this will throw an Error in a future version of PHP) in wp-content/plugins/ucard/ucard.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ucard/admin/panel.php:17
    • > PHP Warning
      require_once(ucard_incoffice.php): failed to open stream: No such file or directory in wp-content/plugins/ucard/ucard.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'ucard_incoffice.php' (include_path='.:/usr/share/php') in wp-content/plugins/ucard/ucard.php on line 9
    • > PHP Warning
      Use of undefined constant ucard_loop - assumed 'ucard_loop' (this will throw an Error in a future version of PHP) in wp-content/plugins/ucard/loops/index.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'ucard_looptemp1.php' (include_path='.:/usr/share/php') in wp-content/plugins/ucard/loops/index.php on line 9
    • > PHP Warning
      Use of undefined constant ucard_img - assumed 'ucard_img' (this will throw an Error in a future version of PHP) in wp-content/plugins/ucard/admin/panel.php on line 12
    • > PHP Warning
      require_once(ucard_looptemp1.php): failed to open stream: No such file or directory in wp-content/plugins/ucard/loops/index.php on line 9

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5 in ucard/assets to your readme.txt
You can take inspiration from this readme.txt

ucard/plugin.php 92% from 13 tests

This is the main PHP file of "Ucard" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ucard.php" instead of "plugin.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
Good job! No executable or dangerous file extensions detected1,354 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS2621588
PHP610478582
SVG111135
JavaScript231349

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin