84% embed-wikimedia

Code Review | Embed Wikimedia

WordPress plugin Embed Wikimedia scored84%from 54 tests.

About plugin

  • Plugin page: embed-wikimedia
  • Plugin version: 0.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2018
  • Latest release: Oct 19, 2019
  • Number of updates: 11
  • Update frequency: every 37.9 days
  • Top authors: samwilson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,949 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.57MB] [CPU: ▼23.30ms] Passed 4 tests

Analyzing server-side resources used by Embed Wikimedia
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1343.04 ▲3.83
Dashboard /wp-admin3.41 ▲0.0747.54 ▼17.23
Posts /wp-admin/edit.php3.53 ▲0.1751.32 ▼1.47
Add New Post /wp-admin/post-new.php3.29 ▼2.5936.54 ▼74.41
Media Library /wp-admin/upload.php3.34 ▲0.1136.49 ▼0.07

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Embed Wikimedia
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.131.66 ▼0.0544.34 ▲4.68
Dashboard /wp-admin2,206 ▲215.91 ▼0.00106.26 ▲0.8340.36 ▼1.85
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0039.89 ▼1.5434.65 ▼0.31
Add New Post /wp-admin/post-new.php6,180 ▲4,66619.79 ▲2.27902.64 ▲193.3236.39 ▼29.59
Media Library /wp-admin/upload.php1,388 ▼04.24 ▲0.0297.31 ▼10.6439.78 ▼7.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 31× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Samwilson\\EmbedWikimedia\\WikimediaProject' not found in wp-content/plugins/embed-wikimedia/src/Wikidata.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Samwilson\\EmbedWikimedia\\WikimediaProject' not found in wp-content/plugins/embed-wikimedia/src/Commons.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/AglInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/embed-wikimedia/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: photos, wikipedia, embed, embeds, wikimedia...

embed-wikimedia/embed-wikimedia.php Passed 13 tests

The main file in "Embed Wikimedia" v. 0.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
52 characters long description:
Embed links to Wikimedia projects such as Wikipedia.

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
Good job! No executable or dangerous file extensions detected1,832 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP432374861,369
Markdown2460162
JavaScript1618155
JSON200115
XML12023
YAML1308

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.11
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes36
▷ Abstract classes38.33%
▷ Concrete classes3391.67%
▷ Final classes00.00%
Methods77
▷ Static methods45.19%
▷ Public methods6584.42%
▷ Protected methods1114.29%
▷ Private methods11.30%
Functions9
▷ Named functions222.22%
▷ Anonymous functions777.78%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/wikidata.png0.36KB0.17KB▼ 52.73%