84% document-emberdder

Code Review | Document Embedder

WordPress plugin Document Embedder scored 84% from 54 tests.

About plugin

  • Plugin page: document-emberdder
  • Plugin version: 1.8.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 10, 2019
  • Latest release: Sep 11, 2023
  • Number of updates: 107
  • Update frequency: every 13.7 days
  • Top authors: abuhayat (53.27%)shehabulislam (47.66%)

Code review

54 tests

User reviews

118 reviews

Install metrics

10,000+ active / 120,407 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
Install script ran successfully

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

Analyzing server-side resources used by Document Embedder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2943.19 ▲2.58
Dashboard /wp-admin3.58 ▲0.2850.59 ▲1.62
Posts /wp-admin/edit.php3.63 ▲0.2850.37 ▲0.32
Add New Post /wp-admin/post-new.php6.19 ▲0.3096.22 ▼3.43
Media Library /wp-admin/upload.php3.44 ▲0.2139.69 ▲5.15

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 195 new files
Database: no new tables, 8 new options
New WordPress options
ppv_import
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
document-emberdder-redirect
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Document Embedder
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,583 ▼1,15210.26 ▼4.481.68 ▼0.4231.39 ▼18.74
Dashboard /wp-admin2,247 ▲594.93 ▼0.9599.25 ▼8.1989.05 ▲42.85
Posts /wp-admin/edit.php2,127 ▲351.97 ▼0.0540.04 ▲0.3437.67 ▲1.82
Add New Post /wp-admin/post-new.php6,614 ▲5,07129.39 ▲10.98999.87 ▲376.1041.32 ▼20.33
Media Library /wp-admin/upload.php1,420 ▲384.19 ▲0.0197.36 ▼6.0647.80 ▲2.84

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • can_compress_scripts
    • theysaidso_admin_options
    • document-emberdder-redirect
    • ppv_import
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% 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 50% 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
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PPV_VER - assumed 'PPV_VER' (this will throw an Error in a future version of PHP) in wp-content/plugins/document-emberdder/inc/Base/Activate.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PPV\\Base\\plugin_basename() in wp-content/plugins/document-emberdder/inc/Base/Activate.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PPV\\Base\\add_action() in wp-content/plugins/document-emberdder/inc/Base/Help.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PPV\\Model\\add_action() in wp-content/plugins/document-emberdder/inc/Model/EnqueueAssets.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/document-emberdder/document-embedder.php:17
    • > PHP Warning
      Use of undefined constant PPV__FILE__ - assumed 'PPV__FILE__' (this will throw an Error in a future version of PHP) in wp-content/plugins/document-emberdder/inc/Base/Activate.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PPV\\Model\\add_shortcode() in wp-content/plugins/document-emberdder/inc/Services/Shortcode.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/document-emberdder/admin/inc/metabox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PPV\\Model\\add_action() in wp-content/plugins/document-emberdder/inc/Model/Metabox.php:12
    • > PHP Warning
      Use of undefined constant PPV__FILE__ - assumed 'PPV__FILE__' (this will throw an Error in a future version of PHP) in wp-content/plugins/document-emberdder/inc/Base/Activate.php on line 23

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 Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: google drive, google docs, document, powerpoint, embed pdf

document-emberdder/document-embedder.php 85% from 13 tests

"Document Embedder" version 1.8.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("document-emberdder.php" instead of "document-embedder.php")

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 plugin39,821 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1033,5671,54815,964
JavaScript91,3054996,597
PO File213,2353,6326,587
Sass1697035,674
CSS83795154,996
SVG2002
JSON1001

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.59
Average class complexity21.27
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity6.23
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes77
▷ Abstract classes22.60%
▷ Concrete classes7597.40%
▷ Final classes00.00%
Methods299
▷ Static methods5719.06%
▷ Public methods299100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions2790.00%
▷ Anonymous functions310.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.22MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/images/shield_success.png21.11KB10.43KB▼ 50.60%
img/error.png29.40KB18.08KB▼ 38.53%
img/donation.png12.88KB5.68KB▼ 55.91%
img/format.png66.53KB43.24KB▼ 35.01%
admin/framework/assets/images/checkerboard.png2.29KB2.54KB0.00%