10% wpfiles

Code Review | WPFiles - WordPress Media Library Folders with CDN, Image Compression, Watermark, Lazy load & more

WordPress plugin WPFiles - WordPress Media Library Folders with CDN, Image Compression, Watermark, Lazy load & more scored 10% from 54 tests.

About plugin

  • Plugin page: wpfiles
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 20, 2022
  • Latest release: Dec 20, 2022
  • Number of updates: 32
  • Update frequency: every 3.7 days
  • Top authors: ripebits (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,600 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/wpfiles/admin/helpers/class-wpfiles-helper.php+782
    unlink(wp-content/plugins/wpfiles/admin/images/watermark/user/): Is a directory

Server metrics [RAM: ▲0.44MB] [CPU: ▲26.91ms] Passed 4 tests

Analyzing server-side resources used by WPFiles - WordPress Media Library Folders with CDN, Image Compression, Watermark, Lazy load & more
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3083.44 ▲9.27
Dashboard /wp-admin3.80 ▲0.50128.46 ▲43.49
Posts /wp-admin/edit.php3.89 ▲0.53120.81 ▲24.53
Add New Post /wp-admin/post-new.php6.45 ▲0.56211.16 ▲55.49
Media Library /wp-admin/upload.php3.67 ▲0.4594.10 ▲30.35
Install /wp-admin/admin.php?page=wpfiles3.7487.59
WPFiles Pro /wp-admin/admin.php?page=wpfiles-pro3.7495.79

Server storage [IO: ▲7.63MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 161 new files
Database: 5 new tables, 130 new options
New tables
wp_wpf_dir_optimize_watermark_images
wp_wpf
wp_wpf_colors
wp_wpf_upload_file_types
wp_wpf_attachment_folder
New WordPress options
wpfiles-native_lazy_loading
wpfiles-cdn
wpfiles-is_folder_media_deleted
wpfiles-compress_original_image
wpfiles-lazyload_active_placeholder
wpfiles-auto_media_format_text
wpfiles-lazy_disable_urls
wpfiles-usage_tracking
wpfiles-activating_user
wpfiles-oxygen_support
...

Browser metrics Passed 4 tests

A check of browser resources used by WPFiles - WordPress Media Library Folders with CDN, Image Compression, Watermark, Lazy load & more
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,236 ▲51424.36 ▲10.3921.43 ▲18.2176.29 ▲0.75
Dashboard /wp-admin2,554 ▲36914.60 ▲9.69763.25 ▲577.59204.88 ▲118.44
Posts /wp-admin/edit.php2,440 ▲35110.95 ▲8.89184.01 ▲117.42162.40 ▲87.03
Add New Post /wp-admin/post-new.php1,714 ▲30130.89 ▲13.121,026.60 ▲60.6289.48 ▲12.20
Media Library /wp-admin/upload.php1,296 ▼8611.40 ▲7.18197.04 ▲12.76120.57 ▲19.46
Install /wp-admin/admin.php?page=wpfiles1,32111.37189.32148.40
WPFiles Pro /wp-admin/admin.php?page=wpfiles-pro2,15411.30193.38254.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 5 tables
    • wp_wpf_attachment_folder
    • wp_wpf_dir_optimize_watermark_images
    • wp_wpf_upload_file_types
    • wp_wpf
    • wp_wpf_colors
  • Zombie WordPress options detected upon uninstall: 132 options
    • wpfiles-account-uninstall-timestamp
    • wpfiles-lazy_output_location
    • wpfiles-media_download
    • wpfiles-woocommerce_sub_folder_creation_by
    • wpfiles-file_types
    • wpfiles-lazy_post_types
    • wpfiles-tatsu_support
    • wpfiles-lazy_disable_classes
    • wpfiles-starred_attachment
    • wpfiles-lazy_animation_type
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpfiles/vendor/enshrined/svg-sanitize/src/svg-scanner.php
    • > /wp-content/plugins/wpfiles/admin/partials/wpfiles-install.php
    • > /wp-content/plugins/wpfiles/public/partials/wpfiles-public-display.php
    • > /wp-content/plugins/wpfiles/admin/partials/wpfiles-admin-display.php
    • > /wp-content/plugins/wpfiles/admin/partials/wpfiles-settings.php
    • > /wp-content/plugins/wpfiles/admin/partials/wpfiles-pro.php
    • > /wp-content/plugins/wpfiles/admin/partials/wpfiles-modules.php
  • 23× 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 wp_kses_post() in wp-content/plugins/wpfiles/admin/partials/trash-notice.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wpfiles/admin/partials/notices/initial-trial-upgrade-notice.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'enshrined\\svgSanitize\\data\\AllowedAttributes' not found in wp-content/plugins/wpfiles/admin/repositories/svg/class-wpfiles-svg-attributes.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wpfiles/admin/partials/notices/account-connect-notice.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wpfiles/admin/partials/notices/show-plugin-conflict-notice.php:4
    • > PHP Fatal error
      Trait 'Wp_Files_Notice_Hooks' not found in wp-content/plugins/wpfiles/admin/class-wpfiles-admin.php on line 18
    • > PHP Fatal error
      Trait 'Wp_Files_LazyLoad_Hooks' not found in wp-content/plugins/wpfiles/admin/repositories/lazyload/class-wpfiles-lazyload.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wpfiles/admin/partials/notices/wpfiles-rate-notice.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wpfiles/admin/partials/notices/free-to-pro-plugin-conversion-notice.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Media_List_Table' not found in wp-content/plugins/wpfiles/admin/repositories/media_library/class-wpfiles-media-library.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

wpfiles/wpfiles.php 92% from 13 tests

The entry point to "WPFiles - WordPress Media Library Folders with CDN, Image Compression, Watermark, Lazy load & more" version 1.1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 235 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected17,526 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PHP994,3305,98215,387
JavaScript162524521,401
SVG400416
CSS1299183
JSON50090
Markdown143049

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity39.74
▷ Minimum class complexity1.00
▷ Maximum class complexity383.00
Average method complexity4.83
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces6
Interfaces2
Traits9
Classes59
▷ Abstract classes00.00%
▷ Concrete classes59100.00%
▷ Final classes00.00%
Methods702
▷ Static methods18826.78%
▷ Public methods59184.19%
▷ Protected methods253.56%
▷ Private methods8612.25%
Functions80
▷ Named functions78.75%
▷ Anonymous functions7391.25%
Constants26
▷ Global constants2388.46%
▷ Class constants311.54%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.34MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/watermark/user/1696227172.png171.59KB20.02KB▼ 88.33%
admin/images/placeholders/placeholder-1.png0.20KB0.20KB0.49%
admin/images/placeholders/placeholder-2.png0.20KB0.20KB0.49%
admin/images/watermark/reset-watermark.png171.59KB20.02KB▼ 88.33%
admin/images/watermark/placeholder.png6.00KB5.03KB▼ 16.19%