84% affiliate-videohive-widget

Code Review | Affiliate VideoHive Widget

WordPress plugin Affiliate VideoHive Widget scored84%from 54 tests.

About plugin

  • Plugin page: affiliate-videohi...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6
  • WordPress version: 6.3.1
  • First release: Oct 14, 2019
  • Latest release: Dec 13, 2020
  • Number of updates: 12
  • Update frequency: every 35.6 days
  • Top authors: stefanpejcic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /884 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.22ms] Passed 4 tests

Server-side resources used by Affiliate VideoHive Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.72 ▼1.31
Dashboard /wp-admin3.40 ▲0.1049.49 ▼1.77
Posts /wp-admin/edit.php3.45 ▲0.1049.72 ▼2.27
Add New Post /wp-admin/post-new.php5.98 ▲0.1084.84 ▼11.51
Media Library /wp-admin/upload.php3.32 ▲0.1040.54 ▲2.90

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_pb_videohive_widget
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Affiliate VideoHive Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.74 ▲0.731.60 ▼0.2042.13 ▼8.35
Dashboard /wp-admin2,195 ▲185.65 ▲0.1091.29 ▲1.3936.95 ▼7.42
Posts /wp-admin/edit.php2,097 ▼31.97 ▲0.0141.12 ▲1.0136.97 ▲1.43
Add New Post /wp-admin/post-new.php1,554 ▲923.18 ▼0.15669.65 ▲0.2256.68 ▼2.01
Media Library /wp-admin/upload.php1,403 ▲64.24 ▲0.04105.56 ▼9.2648.00 ▲2.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_pb_videohive_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/affiliate-videohive-widget/affiliate-videohive-widget.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/affiliate-videohive-widget/inc/class-videohive-widget.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% 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: The official readme.txt is a good inspiration

affiliate-videohive-widget/affiliate-videohive-widget.php Passed 13 tests

The primary PHP file in "Affiliate VideoHive Widget" version 1.0.2 is used by WordPress to initiate all plugin functionality
72 characters long description:
Display VideoHive items as a WordPress widget with your affiliate links.

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
There were no executable files found in this plugin412 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP28920370
JavaScript13124
CSS11018

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity53.00
▷ Minimum class complexity53.00
▷ Maximum class complexity53.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon-256x256.png78.49KB24.76KB▼ 68.45%