78% wp-embed-facebook

Code Review | Magic Embeds

WordPress plugin Magic Embeds scored 78% from 54 tests.

About plugin

  • Plugin page: wp-embed-facebook
  • Plugin version: 3.0.10
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5.1
  • WordPress version: 5.9.2
  • First release: Feb 28, 2014
  • Latest release: Sep 9, 2020
  • Number of updates: 156
  • Update frequency: every 15.3 days
  • Top authors: poxtron (100%)

Code review

54 tests

User reviews

41 reviews

Install metrics

10,000+ active / 372,106 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: ▲0.55MB] [CPU: ▼291.28ms] Passed 4 tests

Server-side resources used by Magic Embeds
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.5856.04 ▲5.17
Dashboard /wp-admin3.96 ▲0.5537.02 ▲2.89
Posts /wp-admin/edit.php4.18 ▲0.5439.99 ▲1.69
Add New Post /wp-admin/post-new.php7.49 ▲0.5296.67 ▼1,174.88
Media Library /wp-admin/upload.php3.91 ▲0.6130.68 ▲6.62
Embed Facebook /wp-admin/options-general.php?page=embedfacebook3.9327.52

Server storage [IO: ▲0.85MB] [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: 45 new files
Database: no new tables, 1 new option
New WordPress options
widget_wef_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Magic Embeds
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,995 ▲24117.80 ▲1.5743.57 ▲37.3819.58 ▲17.06
Dashboard /wp-admin2,943 ▲566.47 ▼0.03130.81 ▼14.41169.74 ▲3.42
Posts /wp-admin/edit.php2,730 ▲393.45 ▲0.0263.71 ▼1.96140.90 ▼6.38
Add New Post /wp-admin/post-new.php1,775 ▲11421.45 ▲4.69461.96 ▲8.94173.07 ▲13.48
Media Library /wp-admin/upload.php1,734 ▲365.74 ▲0.05148.32 ▲1.89207.82 ▲10.76
Embed Facebook /wp-admin/options-general.php?page=embedfacebook4,6223.0460.16161.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_wef_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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 fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-embed-facebook/templates/custom-embeds/photo.php
    • > /wp-content/plugins/wp-embed-facebook/templates/custom-embeds/album.php
  • 71× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/social-plugin.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/photo.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'SIGAMI\\WP_Embed_FB\\Plugin' not found in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/post.php:19
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/album.php on line 20
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/album.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/post.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/post.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/post.php on line 8
    • > PHP Notice
      Undefined variable: fb_data in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/page.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-embed-facebook/templates/custom-embeds/page.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-embed-facebook/wp-embed-facebook.php 92% from 13 tests

This is the main PHP file of "Magic Embeds" version 3.0.10, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 334 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected4,205 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP214421,0533,252
Sass26810480
JavaScript47559433
CSS34340

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity26.50
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes17.14%
▷ Concrete classes1392.86%
▷ Final classes430.77%
Methods124
▷ Static methods9677.42%
▷ Public methods11693.55%
▷ Protected methods32.42%
▷ Private methods54.03%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.60MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/banners/WPEmbedFBExtended.png564.55KB239.05KB▼ 57.66%
inc/banners/icon-128x128.png10.29KB4.36KB▼ 57.64%
inc/banners/icon-256x256.png13.23KB5.32KB▼ 59.78%
templates/images/share.png0.71KB0.78KB0.00%
templates/images/like.png0.68KB0.78KB0.00%