78% smugmug-embed

Code Review | SmugMug Embed

WordPress plugin SmugMug Embed scored78%from 54 tests.

About plugin

  • Plugin page: smugmug-embed
  • Plugin version: 3.13
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.5.1
  • WordPress version: 6.3.1
  • First release: Feb 14, 2013
  • Latest release: Nov 16, 2020
  • Number of updates: 68
  • Update frequency: every 41.7 days
  • Top authors: twicklund (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /7,220 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.89MB] [CPU: ▲483.83ms] 75% from 4 tests

Server-side resources used by SmugMug Embed
The following require your attention
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 483.83ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /4.62 ▲1.16541.25 ▲495.17
Dashboard /wp-admin4.20 ▲0.86539.65 ▲468.39
Posts /wp-admin/edit.php4.33 ▲0.98554.92 ▲503.07
Add New Post /wp-admin/post-new.php6.58 ▲0.69595.99 ▲468.69
Media Library /wp-admin/upload.php4.28 ▲1.05548.70 ▲510.51

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 181 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by SmugMug Embed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲20913.79 ▼0.357.77 ▲6.1940.36 ▲0.52
Dashboard /wp-admin2,249 ▲755.80 ▲0.28102.25 ▲9.6644.47 ▲7.38
Posts /wp-admin/edit.php2,156 ▲592.26 ▲0.2846.22 ▲7.0231.85 ▼7.37
Add New Post /wp-admin/post-new.php1,531 ▲318.84 ▼4.23638.61 ▼37.8438.77 ▼19.86
Media Library /wp-admin/upload.php1,453 ▲594.46 ▲0.23114.99 ▲17.9343.19 ▼1.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% 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 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/smugmug-embed/vendor/lildude/phpsmug/test/bootstrap.php
  • 55× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/smugmug-embed/vendor/lildude/phpsmug/test/phpSmug/Tests/ClientSmugMugTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/smugmug-embed/vendor/guzzlehttp/guzzle/src/Client.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/smugmug-embed/vendor/guzzlehttp/promises/src/EachPromise.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/smugmug-embed/vendor/guzzlehttp/promises/src/Promise.php:9
    • > PHP Warning
      require_once(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/smugmug-embed/vendor/lildude/phpsmug/examples/example.php on line 38
    • > PHP Warning
      require_once(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/smugmug-embed/vendor/lildude/phpsmug/examples/example-external-links.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smugmug-embed/SmugMugEmbed.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/smugmug-embed/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/smugmug-embed/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/smugmug-embed/vendor/lildude/phpsmug/examples/example-oauth.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: smugmug, smug mug, images, embed, integration

smugmug-embed/SmugMugEmbed.php 92% from 13 tests

The main PHP file in "SmugMug Embed" ver. 3.13 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("smugmug-embed.php" instead of "SmugMugEmbed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected17,264 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
PHP1112,1345,75610,750
Markdown231,29803,797
JavaScript383401,135
CSS38026754
JSON900667
YAML47668
XML25155
reStructuredText1326018
Dockerfile18010
make1409
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity14.03
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces13
Interfaces15
Traits2
Classes77
▷ Abstract classes00.00%
▷ Concrete classes77100.00%
▷ Final classes1012.99%
Methods780
▷ Static methods729.23%
▷ Public methods64482.56%
▷ Protected methods70.90%
▷ Private methods12916.54%
Functions155
▷ Named functions6541.94%
▷ Anonymous functions9058.06%
Constants63
▷ Global constants00.00%
▷ Class constants63100.00%
▷ Public constants63100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/lildude/phpsmug/docs/favicon.png3.79KB2.18KB▼ 42.47%
vendor/lildude/phpsmug/examples/phpSmug-logo.png5.22KB2.80KB▼ 46.42%