84% simply-documents

Code Review | Simply Documents

WordPress plugin Simply Documents scored84%from 54 tests.

About plugin

  • Plugin page: simply-documents
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 12, 2018
  • Latest release: Sep 12, 2018
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: javahat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /884 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.65MB] [CPU: ▲6.37ms] Passed 4 tests

Server-side resources used by Simply Documents
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.83 ▲1.3748.34 ▲5.62
Dashboard /wp-admin5.07 ▲1.7762.24 ▲10.37
Posts /wp-admin/edit.php5.12 ▲1.7759.71 ▲6.57
Add New Post /wp-admin/post-new.php7.64 ▲1.7596.30 ▲2.93
Media Library /wp-admin/upload.php4.94 ▲1.7152.36 ▲13.96
Document Types /wp-admin/edit.php?post_type=simply_document_type4.9752.52
Add New /wp-admin/post-new.php?post_type=simply_documents5.1867.12
Add-ons /wp-admin/edit.php?post_type=acf&page=acf-addons4.9044.18
Export /wp-admin/edit.php?post_type=acf&page=acf-export4.9045.63
Custom Fields /wp-admin/edit.php?post_type=acf5.0852.63
Dashboard /wp-admin/admin.php?page=simply_dashboard_admin_page4.9042.23
Documents /wp-admin/edit.php?post_type=simply_documents4.9740.19

Server storage [IO: ▲3.02MB] [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: 144 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
acf_version
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Simply Documents
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲9514.24 ▼0.061.60 ▼0.4335.58 ▼5.33
Dashboard /wp-admin2,285 ▲1085.61 ▼0.0493.26 ▼2.4946.24 ▲0.83
Posts /wp-admin/edit.php2,187 ▲902.04 ▲0.0332.86 ▼6.3138.54 ▲1.25
Add New Post /wp-admin/post-new.php6,693 ▲5,16724.87 ▲1.661,018.60 ▲325.1440.55 ▼32.84
Media Library /wp-admin/upload.php1,487 ▲874.17 ▲0.01104.37 ▼6.7754.14 ▲9.08
Document Types /wp-admin/edit.php?post_type=simply_document_type1,1371.9735.0233.79
Add New /wp-admin/post-new.php?post_type=simply_documents2,6337.95168.9951.92
Add-ons /wp-admin/edit.php?post_type=acf&page=acf-addons1,0922.1926.0134.14
Export /wp-admin/edit.php?post_type=acf&page=acf-export1,0212.1221.7833.44
Custom Fields /wp-admin/edit.php?post_type=acf1,2462.0147.9344.54
Dashboard /wp-admin/admin.php?page=simply_dashboard_admin_page9811.9922.1129.65
Documents /wp-admin/edit.php?post_type=simply_documents1,1831.9630.3529.39

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • acf_version
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 43× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/controllers/upgrade.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/fields/google-map.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/fields/post_object.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/controllers/export.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/fields/email.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/fields/radio.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/fields/taxonomy.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/fields/checkbox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simply-documents/simply-documents.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/simply-documents/lib/advanced-custom-fields/core/fields/number.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
5 plugin tags: format content, documents, document types, table, list documents

simply-documents/simply-documents.php 92% from 13 tests

"Simply Documents" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 225 characters long)

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
No dangerous file extensions were detected37,981 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
PO File249,70114,11221,302
PHP464,2374,8129,835
JavaScript62,1201,5924,139
CSS78435642,705

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity24.23
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods286
▷ Static methods00.00%
▷ Public methods286100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions59
▷ Named functions59100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/advanced-custom-fields/core/fields/date_picker/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
lib/advanced-custom-fields/core/fields/date_picker/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
lib/advanced-custom-fields/images/sprite.png5.94KB2.82KB▼ 52.51%
lib/advanced-custom-fields/images/sprite@2x.png12.53KB4.91KB▼ 60.81%
lib/advanced-custom-fields/images/arrows.png0.24KB0.24KB0.00%