58% references-for-wikidata

Code Review | Wikidata References for WordPress

WordPress plugin Wikidata References for WordPress scored58%from 54 tests.

About plugin

  • Plugin page: references-for-wi...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9
  • WordPress version: 6.3.1
  • First release: Nov 22, 2017
  • Latest release: Dec 1, 2017
  • Number of updates: 5
  • Update frequency: every 2.4 days
  • Top authors: zeko3991 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /900 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.77ms] Passed 4 tests

Server-side resources used by Wikidata References for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.46 ▼7.30
Dashboard /wp-admin3.35 ▲0.0542.53 ▼5.42
Posts /wp-admin/edit.php3.40 ▲0.0547.99 ▼8.79
Add New Post /wp-admin/post-new.php5.95 ▲0.0796.10 ▼9.58
Media Library /wp-admin/upload.php3.27 ▲0.0539.88 ▲6.01
WikiData References /wp-admin/options-general.php?page=wikidata-references3.3531.68

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Wikidata References for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲6613.38 ▼0.971.88 ▼0.2045.29 ▲2.41
Dashboard /wp-admin2,218 ▲304.87 ▼1.01114.69 ▼26.0045.19 ▼15.19
Posts /wp-admin/edit.php2,104 ▲122.05 ▲0.0243.81 ▼6.4741.00 ▼3.81
Add New Post /wp-admin/post-new.php1,525 ▲517.66 ▼5.58680.75 ▼14.8356.89 ▼8.94
Media Library /wp-admin/upload.php1,397 ▲64.25 ▲0.07134.65 ▲17.3055.86 ▲2.59
WikiData References /wp-admin/options-general.php?page=wikidata-references1,1021.7324.3826.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Error in wp-content/plugins/references-for-wikidata/uninstall.php+46
    Uncaught Error: Using $this when not in object context in wp-content/plugins/references-for-wikidata/uninstall.php:46
    Stack trace:
    #0 wp-admin/includes/plugin.php(1245): include_once()
    #1 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • The plugin did not uninstall correctly, leaving 24 files (0.36MB) in the plugin directory
    • (new file) admin/js/wikidata-references-admin.js
    • (new file) admin/partials/wikidata-references-admin-display.php
    • (new file) admin/css/wikidata-references-admin.css
    • (new file) README.md
    • (new file) LICENSE
    • (new file) LICENSE.txt
    • (new file) admin/class-wikidata-references-admin.php
    • (new file) README.txt
    • (new file) admin/partials/images/Wikidata-logo-en.svg
    • (new file) admin/css/wikidata-references-admin-ie.css
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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
Everything seems fine, however this is by no means 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 items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/references-for-wikidata/admin/partials/wikidata-references-admin-display.php:22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=wikidata-references
    • > Network (severe)
    wp-content/plugins/wikidata-references/bootstrap-4.0.0-alpha.6-dist/css/bootstrap.min.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=wikidata-references
    • > Network (severe)
    wp-content/plugins/wikidata-references/bootstrap-4.0.0-alpha.6-dist/js/bootstrap.min.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% 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
These attributes need your attention:
  • Donate link: Please fix this invalid url: "zeko3991@gmail.com"
You can look at the official readme.txt

references-for-wikidata/wikidata-references.php 85% from 13 tests

The main PHP file in "Wikidata References for WordPress" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("references-for-wikidata.php" instead of "wikidata-references.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,374 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP9250580752
CSS36321216
PO File24145210
JavaScript24580167
Markdown112022
SVG1007

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.30
Average class complexity16.67
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3690.00%
▷ Protected methods00.00%
▷ Private methods410.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected