84% wp-aparat

Code Review | Aparat for WordPress

WordPress plugin Aparat for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: wp-aparat
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Nov 11, 2016
  • Latest release: Jul 22, 2022
  • Number of updates: 7
  • Update frequency: every 296.0 days
  • Top authors: as911 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /15,797 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.10MB] [CPU: ▼4.51ms] Passed 4 tests

An overview of server-side resources used by Aparat for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0938.53 ▲0.13
Dashboard /wp-admin3.40 ▲0.1043.31 ▼7.22
Posts /wp-admin/edit.php3.52 ▲0.1648.57 ▼2.40
Add New Post /wp-admin/post-new.php5.98 ▲0.1086.83 ▼8.56
Media Library /wp-admin/upload.php3.32 ▲0.1038.73 ▲3.80

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

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

Browser metrics Passed 4 tests

Aparat for WordPress: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲13313.56 ▼0.851.80 ▲0.1443.16 ▼4.37
Dashboard /wp-admin2,248 ▲605.82 ▲0.96103.41 ▲2.7466.76 ▲22.88
Posts /wp-admin/edit.php2,131 ▲422.01 ▲0.0135.30 ▼5.4929.37 ▼7.24
Add New Post /wp-admin/post-new.php6,389 ▲4,85327.58 ▲4.57931.95 ▲302.2442.42 ▼18.72
Media Library /wp-admin/upload.php1,421 ▲394.24 ▲0.08108.18 ▲11.4380.27 ▲37.34

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_wpaparat_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: lastVideoIndex in wp-content/plugins/wp-aparat/templates/widget-item.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_aparat_human_duration() in wp-content/plugins/wp-aparat/templates/widget-item.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-aparat/aparat-admin.php:7
    • > PHP Notice
      Undefined variable: figure_size in wp-content/plugins/wp-aparat/templates/widget-item.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-aparat/AparatWidget.php:4
    • > PHP Notice
      Undefined variable: open_in_new_tab in wp-content/plugins/wp-aparat/templates/widget-item.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
3 plugin tags: embed, video, aparat

wp-aparat/aparat.php 92% from 13 tests

The primary PHP file in "Aparat for WordPress" version 2.2.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-aparat.php" instead of "aparat.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected866 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP679160435
CSS403172
JavaScript592170
PO File1526986
SVG2002
JSON1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.50
▷ Minimum class complexity10.00
▷ Maximum class complexity17.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1083.33%
▷ Protected methods00.00%
▷ Private methods216.67%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/aparat-nothumb.png13.60KB6.27KB▼ 53.87%
assets/images/icon.png14.87KB0.88KB▼ 94.10%
assets/images/aparat-logo.png9.84KB3.60KB▼ 63.45%