73% categories-as-folders

Code Review | Categories as Folders

WordPress plugin Categories as Folders scored 73% from 54 tests.

About plugin

  • Plugin page: categories-as-fol...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 22, 2020
  • Latest release: Sep 27, 2020
  • Number of updates: 15
  • Update frequency: every 0.3 days
  • Top authors: mbsdevel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 466 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.14MB] [CPU: ▲2.06ms] Passed 4 tests

Analyzing server-side resources used by Categories as Folders
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.14 ▼4.83
Dashboard /wp-admin3.35 ▲0.0556.15 ▲8.52
Posts /wp-admin/edit.php3.40 ▲0.0551.21 ▲3.96
Add New Post /wp-admin/post-new.php5.19 ▼0.7097.45 ▲0.58
Media Library /wp-admin/upload.php3.28 ▲0.0550.27 ▲19.02
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=document3.2753.42
Categories as Folders /wp-admin/options-general.php?page=categories-as-folders-setting-admin3.2445.96
Todos os documentos /wp-admin/edit.php?post_type=document3.3355.43
Novo /wp-admin/post-new.php?post_type=document3.2044.40

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 47 new files
Database: no new tables, 8 new options
New WordPress options
category_children
caf_settings
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Categories as Folders
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲19213.58 ▼0.796.12 ▲4.1842.17 ▼0.17
Dashboard /wp-admin2,248 ▲605.92 ▲0.03120.23 ▲7.0744.29 ▲0.33
Posts /wp-admin/edit.php2,131 ▲421.99 ▼0.0043.09 ▲6.7240.22 ▲8.67
Add New Post /wp-admin/post-new.php1,425 ▼10817.51 ▼5.53970.02 ▲338.3072.26 ▲20.88
Media Library /wp-admin/upload.php1,427 ▲394.21 ▼0.11162.37 ▼64.7674.40 ▲3.23
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=document1,4822.1446.4351.14
Categories as Folders /wp-admin/options-general.php?page=categories-as-folders-setting-admin8652.0441.6847.31
Todos os documentos /wp-admin/edit.php?post_type=document1,1181.9666.1764.64
Novo /wp-admin/post-new.php?post_type=document2,3987.66358.92156.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • category_children
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • caf_settings
    • widget_recent-comments

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=document
    • > Notice in wp-content/plugins/categories-as-folders/admin/class-categories-as-folders-admin-meta.php+235
    Undefined index: document_files_nonce
    • > GET request to /wp-admin/post-new.php?post_type=document
    • > Warning in wp-content/plugins/categories-as-folders/includes/CAF/Document.php+19
    Illegal string offset 'display_media'

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 items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/categories-as-folders/public/partials/categories-as-folders-public-display.php
    • > /wp-content/plugins/categories-as-folders/admin/partials/categories-as-folders-admin-display.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/categories-as-folders/public/templates/breadcrumb.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/categories-as-folders/public/class-categories-as-folders-public.php:185
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/categories-as-folders/includes/class-categories-as-folders-settings.php:154
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/categories-as-folders/admin/class-categories-as-folders-admin-meta.php:265
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/categories-as-folders/admin/class-categories-as-folders-admin-meta.php:265
    • > PHP Fatal error
      Uncaught Error: Class 'CAF\\Folder' not found in wp-content/plugins/categories-as-folders/includes/CAF/Domain/Folder.php:11

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 Passed 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
4 plugin tags: media, documents, categories, posts

categories-as-folders/categories-as-folders.php Passed 13 tests

Analyzing the main PHP file in "Categories as Folders" version 1.0.0
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

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
Success! There were no dangerous files found in this plugin1,349 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP274458361,293
CSS391332
JSON10018
JavaScript24546

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.59
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods110
▷ Static methods2018.18%
▷ Public methods9889.09%
▷ Protected methods43.64%
▷ Private methods87.27%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants1
▷ Global constants1100.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
7 PNG files occupy 0.23MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/folder-1.png18.74KB7.99KB▼ 57.34%
public/img/folders-2.png25.80KB10.23KB▼ 60.36%
public/img/pdf-1.png17.31KB9.58KB▼ 44.64%
public/img/folders-1.png2.88KB2.10KB▼ 27.12%
public/img/video-1.png55.71KB19.32KB▼ 65.31%