84% wpyog-documents

Code Review | WPYog Documents

WordPress plugin WPYog Documents scored84%from 54 tests.

About plugin

  • Plugin page: wpyog-documents
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 16, 2017
  • Latest release: Sep 29, 2023
  • Number of updates: 26
  • Update frequency: every 86.2 days
  • Top authors: wpyog (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /3,652 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼1.78ms] Passed 4 tests

This is a short check of server-side resources used by WPYog Documents
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.83 ▼2.28
Dashboard /wp-admin3.43 ▲0.1256.17 ▲2.30
Posts /wp-admin/edit.php3.55 ▲0.1958.08 ▲13.05
Add New Post /wp-admin/post-new.php6.13 ▲0.2485.86 ▼14.22
Media Library /wp-admin/upload.php3.33 ▲0.1040.84 ▲7.10
Category /wp-admin/edit-tags.php?taxonomy=wpyog_document_category&post_type=wpyog_document3.3543.04
WPYog Documents /wp-admin/edit.php?post_type=wpyog_document3.4044.49
Shortcode Reference /wp-admin/edit.php?post_type=wpyog_document&page=document-shortcode-ref3.3339.34
Add Document /wp-admin/post-new.php?post_type=wpyog_document6.1388.36

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WPYog Documents
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲21314.87 ▲0.511.76 ▲0.1739.92 ▼2.08
Dashboard /wp-admin2,374 ▲1976.16 ▲0.51120.92 ▲20.6744.07 ▼1.48
Posts /wp-admin/edit.php2,304 ▲2013.37 ▲1.3550.68 ▲13.3831.41 ▼3.46
Add New Post /wp-admin/post-new.php1,559 ▲3123.30 ▲0.30666.94 ▼15.3236.83 ▼30.55
Media Library /wp-admin/upload.php1,447 ▲474.17 ▼0.0381.71 ▼25.2743.77 ▲1.59
Category /wp-admin/edit-tags.php?taxonomy=wpyog_document_category&post_type=wpyog_document1,4813.1640.6631.77
WPYog Documents /wp-admin/edit.php?post_type=wpyog_document1,3223.4349.3530.87
Shortcode Reference /wp-admin/edit.php?post_type=wpyog_document&page=document-shortcode-ref1,0333.0538.6275.99
Add Document /wp-admin/post-new.php?post_type=wpyog_document6,22319.57869.3234.71

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpyog-documents/index.php:12
    • > PHP Notice
      Undefined variable: query in wp-content/plugins/wpyog-documents/templates/research-document-list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/wpyog-documents/templates/research-document-list.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4 in wpyog-documents/assets to your readme.txt
You can look at the official readme.txt

wpyog-documents/index.php 92% from 13 tests

Analyzing the main PHP file in "WPYog Documents" version 1.3.2
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wpyog-documents.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected3,474 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
SVG2102,681
PHP23433408
CSS3273358
JavaScript26627

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions2090.91%
▷ Anonymous functions29.09%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/icons/icon-arrow-left.png1.45KB0.40KB▼ 72.16%
css/icons/icon-close.png1.18KB0.43KB▼ 63.71%
img/wpyog-doc-icon.png21.58KB7.72KB▼ 64.24%
css/icons/icon-arrow-right.png1.46KB0.41KB▼ 72.00%
css/icons/broken-image.png0.26KB0.17KB▼ 33.33%