73% safan-doc

Code Review | Safan Doc

WordPress plugin Safan Doc scored 73% from 54 tests.

About plugin

  • Plugin page: safan-doc
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 18, 2021
  • Latest release: Aug 18, 2021
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: largbasket (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 277 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.42MB] [CPU: ▼0.63ms] Passed 4 tests

Server-side resources used by Safan Doc
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4444.72 ▲6.74
Dashboard /wp-admin3.75 ▲0.4551.91 ▲0.03
Posts /wp-admin/edit.php3.79 ▲0.4354.64 ▲13.03
Add New Post /wp-admin/post-new.php6.37 ▲0.4888.47 ▼11.66
Media Library /wp-admin/upload.php3.58 ▲0.3536.49 ▲2.38
Add New /wp-admin/post-new.php?post_type=doc6.5087.07
Safan Docs /wp-admin/edit.php?post_type=doc3.7140.95
Categories /wp-admin/edit-tags.php?taxonomy=catrgory&post_type=doc3.6638.75

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 493 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Safan Doc
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,229 ▲49419.03 ▲4.369.68 ▲7.6541.27 ▼2.62
Dashboard /wp-admin2,509 ▲3179.20 ▲4.25174.49 ▲67.5338.03 ▲1.17
Posts /wp-admin/edit.php2,415 ▲3266.08 ▲4.0274.45 ▲33.2232.01 ▼2.00
Add New Post /wp-admin/post-new.php1,613 ▲9420.08 ▼3.13759.61 ▲156.2438.74 ▼13.54
Media Library /wp-admin/upload.php1,567 ▲1796.60 ▲2.41110.11 ▲15.2843.19 ▼2.54
Add New /wp-admin/post-new.php?post_type=doc7,01529.071,044.4344.75
Safan Docs /wp-admin/edit.php?post_type=doc1,4246.0672.9727.34
Categories /wp-admin/edit-tags.php?taxonomy=catrgory&post_type=doc1,6045.9365.2026.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% 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 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
Please fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/safan-doc/public/partials/safan-doc-public-display.php
    • > /wp-content/plugins/safan-doc/admin/partials/safan-doc-admin-display.php
    • > /wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 116× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Container\\Fulfillable\\Fulfillable' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Container/Fulfillable/Fulfillable_Collection.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Meta_Datastore' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Datastore/Network_Datastore.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Field/Oembed_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Comparer\\Comparer' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Container/Condition/Comparer/Scalar_Comparer.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/templates/Container/nav_menu_item.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Comparer\\Comparer' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Container/Condition/Comparer/Any_Contain_Comparer.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Select_Field' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Field/Gravity_Form_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Container/Term_Meta_Container.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\User_Role_Condition' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Container/Condition/Current_User_Role_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/safan-doc/vendor/htmlburger/carbon-fields/core/Field/Association_Field.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=doc
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=73ad3591e7bc95f4777a+1:627
    wp.compose.withState is deprecated since version 5.8. Please use wp.element.useState instead.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Setting Page), #2 (Product Archive Page), #3 (Single Product Page)
You can take inspiration from this readme.txt

safan-doc/safan-doc.php Passed 13 tests

The primary PHP file in "Safan Doc" version 1.0.0 is used by WordPress to initiate all plugin functionality
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 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin31,411 lines of code in 429 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1765,1988,51512,958
PHP1592,6077,0199,008
CSS154161,1943,941
PO File217048891,874
Sass4833401,746
SVG4001,461
JSON300355
Markdown324068

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.86
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces22
Interfaces5
Traits0
Classes128
▷ Abstract classes118.59%
▷ Concrete classes11791.41%
▷ Final classes10.85%
Methods913
▷ Static methods9210.08%
▷ Public methods73980.94%
▷ Protected methods16518.07%
▷ Private methods90.99%
Functions110
▷ Named functions3027.27%
▷ Anonymous functions8072.73%
Constants29
▷ Global constants620.69%
▷ Class constants2379.31%
▷ Public constants23100.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
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/template/images/download.png67.62KB27.51KB▼ 59.31%