68% fb-viral-downloader

Code Review | Social Viral Downloader

WordPress plugin Social Viral Downloader scored68%from 54 tests.

About plugin

  • Plugin page: fb-viral-downloader
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3
  • WordPress version: 6.3.1
  • First release: Jan 3, 2014
  • Latest release: Sep 21, 2015
  • Number of updates: 39
  • Update frequency: every 28.8 days
  • Top authors: Dualcube (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

20+ active /11,178 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.43MB] [CPU: ▲4.50ms] Passed 4 tests

A check of server-side resources used by Social Viral Downloader
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3547.73 ▲7.01
Dashboard /wp-admin3.81 ▲0.4781.67 ▲15.64
Posts /wp-admin/edit.php3.85 ▲0.4955.61 ▲4.56
Add New Post /wp-admin/post-new.php6.35 ▲0.4799.87 ▼1.58
Media Library /wp-admin/upload.php3.66 ▲0.4350.07 ▲7.99
Tags /wp-admin/edit-tags.php?taxonomy=tags&post_type=downloadables3.6541.80
Categories /wp-admin/edit-tags.php?taxonomy=categories&post_type=downloadables3.6636.88
Add Downloadable /wp-admin/post-new.php?post_type=downloadables3.8277.30
All Downloadable /wp-admin/edit.php?post_type=downloadables3.7141.98
Downloadables Logs /wp-admin/edit.php?post_type=downloadables&page=downloadables_logs3.6844.32

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 69 new files
Database: 1 new table, 6 new options
New tables
wp_download_data
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Social Viral Downloader
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,155 ▲39413.54 ▼0.7510.07 ▲8.2242.88 ▲3.29
Dashboard /wp-admin2,446 ▲2695.60 ▼0.0988.64 ▼3.3276.47 ▲35.80
Posts /wp-admin/edit.php2,355 ▲2552.02 ▼0.0242.58 ▲3.6234.24 ▼4.69
Add New Post /wp-admin/post-new.php1,919 ▲38320.31 ▼2.97765.64 ▲98.2664.19 ▲9.77
Media Library /wp-admin/upload.php1,646 ▲2464.27 ▲0.0695.15 ▼11.7575.34 ▲33.63
Tags /wp-admin/edit-tags.php?taxonomy=tags&post_type=downloadables1,4982.3028.2933.40
Categories /wp-admin/edit-tags.php?taxonomy=categories&post_type=downloadables1,5262.2830.8530.72
Add Downloadable /wp-admin/post-new.php?post_type=downloadables2,3533.9774.3489.98
All Downloadable /wp-admin/edit.php?post_type=downloadables1,4962.0036.0035.05
Downloadables Logs /wp-admin/edit.php?post_type=downloadables&page=downloadables_logs1,4444.2365.1058.80

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_download_data
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fb-viral-downloader/includes/fb-viral-downloader-core-functions.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fb-viral-downloader/includes/fb-viral-downloader-core-functions.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=downloadables
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'model')" "TypeError: Cannot read properties of undefined (reading 'model')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/fb-viral-downloader/assets/admin/js/insert.js?ver=1.0.0:4:34)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=downloadables
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'model')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 51 tag instead of maximum 10
The official readme.txt is a good inspiration

fb-viral-downloader/viral_downloader.php 92% from 13 tests

The primary PHP file in "Social Viral Downloader" version 2.0.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("fb-viral-downloader.php" instead of "viral_downloader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin5,257 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP204253632,276
CSS73732202,234
JavaScript11294575
PO File17483165
SVG1017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity26.67
▷ Minimum class complexity2.00
▷ Maximum class complexity165.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods118
▷ Static methods21.69%
▷ Public methods118100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
25 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/f005.png0.27KB0.34KB0.00%
lib/jquery/upload/images/Placeholderpdf.png14.58KB5.45KB▼ 62.63%
lib/jquery/upload/images/Placeholderxls.png6.25KB3.17KB▼ 49.24%
assets/images/dualcube.png3.29KB0.65KB▼ 80.17%
assets/images/viral_downloader.png1.57KB0.90KB▼ 42.50%