72% simple-media-directory

Code Review | Simple Video Directory

WordPress plugin Simple Video Directory scored72%from 54 tests.

About plugin

  • Plugin page: simple-media-dire...
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jan 11, 2019
  • Latest release: Aug 9, 2023
  • Number of updates: 14
  • Update frequency: every 119.5 days
  • Top authors: quantumcloud (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,573 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.07MB] [CPU: ▼9.02ms] Passed 4 tests

Analyzing server-side resources used by Simple Video Directory
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.02 ▼0.07
Dashboard /wp-admin3.41 ▲0.1152.72 ▼0.57
Posts /wp-admin/edit.php3.53 ▲0.1752.55 ▼3.16
Add New Post /wp-admin/post-new.php5.30 ▼0.5865.07 ▼31.23
Media Library /wp-admin/upload.php3.34 ▲0.1136.05 ▼1.12
Settings /wp-admin/edit.php?post_type=smd&page=smd_settings3.3136.03
New List /wp-admin/post-new.php?post_type=smd3.3239.46
Import /wp-admin/edit.php?post_type=smd&page=qcsmd_bimport_page3.3034.43
Support /wp-admin/edit.php?post_type=smd&page=qcpro-promo-page-smd-free-page-123za3.3034.39
List Categories /wp-admin/edit-tags.php?taxonomy=smd_cat&post_type=smd3.3335.78
Manage List Items /wp-admin/edit.php?post_type=smd3.3841.01

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 254 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
qc_smd_rating_active_time
smd_ot_convrt

Browser metrics Passed 4 tests

A check of browser resources used by Simple Video Directory
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,001 ▲24013.98 ▼0.4013.01 ▲11.1936.46 ▼12.13
Dashboard /wp-admin2,264 ▲844.77 ▼0.8192.49 ▲1.7840.11 ▲1.31
Posts /wp-admin/edit.php2,175 ▲722.23 ▲0.2939.02 ▲4.3234.63 ▼2.49
Add New Post /wp-admin/post-new.php6,267 ▲4,74019.37 ▼3.78933.23 ▲246.0536.99 ▼23.81
Media Library /wp-admin/upload.php1,472 ▲724.33 ▲0.1599.61 ▼19.9544.05 ▼4.07
Settings /wp-admin/edit.php?post_type=smd&page=smd_settings1,3481.9531.8829.10
New List /wp-admin/post-new.php?post_type=smd2,0153.8178.2445.03
Import /wp-admin/edit.php?post_type=smd&page=qcsmd_bimport_page9821.7927.8631.40
Support /wp-admin/edit.php?post_type=smd&page=qcpro-promo-page-smd-free-page-123za1,4061.7826.83108.16
List Categories /wp-admin/edit-tags.php?taxonomy=smd_cat&post_type=smd1,3461.9030.5931.07
Manage List Items /wp-admin/edit.php?post_type=smd1,1602.3332.7330.32

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • smd_ot_convrt
    • qc_smd_rating_active_time
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=smd
    • > User deprecated in wp-includes/functions.php+5828
    Hook dbx_post_advanced is deprecated since version 3.7.0! Use add_meta_boxes instead.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-media-directory/qc-smd-directory-main.php
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-media-directory/qc-opd-ajax-stuffs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-media-directory/inc/cmb/custom-meta-boxes.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-media-directory/inc/cmb/classes.fields.php:638
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/simple-media-directory/templates/style-2/template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/simple-media-directory/templates/style-1/template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-media-directory/qc-op-directory-assets.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/simple-media-directory/templates/simple/template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-media-directory/qc-support-promo-page/class-qc-support-promo-page.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-media-directory/qc-opd-setting-options.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-media-directory/class-qc-free-plugin-upgrade-notice.php:34

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: directory, media directory, video gallery, media gallery, video portfolio...

simple-media-directory/qc-smd-directory-main.php 85% from 13 tests

"Simple Video Directory" version 1.4.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-media-directory.php" instead of "qc-smd-directory-main.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin37,161 lines of code in 149 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript703,3113,32913,809
CSS356763008,969
JSON9007,247
PHP261,6307324,266
SVG3102,685
Markdown235089
Bourne Shell124055
Sass34141

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity8.93
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes13.45%
▷ Concrete classes2896.55%
▷ Final classes00.00%
Methods145
▷ Static methods21.38%
▷ Public methods14096.55%
▷ Protected methods10.69%
▷ Private methods42.76%
Functions55
▷ Named functions55100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
50 PNG files occupy 0.44MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/cmb/css/vendor/jquery-ui/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
qc-support-promo-page/images/iList-icon-256x256.png12.99KB6.05KB▼ 53.44%
inc/cmb/css/vendor/jquery-ui/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
qc-support-promo-page/images/icon-pack/service-04.png1.67KB0.90KB▼ 46.47%
assets/images/menu_icon.png2.81KB0.12KB▼ 95.66%