78% xshare

Code Review | xShare

WordPress plugin xShare scored78%from 54 tests.

About plugin

  • Plugin page: xshare
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.5
  • WordPress version: 6.3.1
  • First release: Sep 9, 2020
  • Latest release: Sep 9, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: anwerashif (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /423 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.43ms] Passed 4 tests

Analyzing server-side resources used by xShare
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0243.31 ▼3.38
Dashboard /wp-admin3.33 ▲0.0256.07 ▲6.90
Posts /wp-admin/edit.php3.38 ▲0.0252.99 ▲1.93
Add New Post /wp-admin/post-new.php5.93 ▲0.0487.50 ▼5.65
Media Library /wp-admin/upload.php3.25 ▲0.0239.69 ▲1.38

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for xShare
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.35 ▲0.062.09 ▲0.2140.59 ▼3.22
Dashboard /wp-admin2,211 ▲315.58 ▼0.1387.83 ▼3.2840.93 ▼2.03
Posts /wp-admin/edit.php2,116 ▲132.01 ▲0.0436.55 ▼3.0333.55 ▼1.91
Add New Post /wp-admin/post-new.php1,549 ▲2123.22 ▲2.03695.20 ▲23.8551.15 ▼2.92
Media Library /wp-admin/upload.php1,416 ▲164.21 ▼0.02112.52 ▲0.3848.65 ▲1.62

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/xshare/index.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/xshare/admin/panel.php:17
    • > PHP Warning
      Use of undefined constant xshare_img - assumed 'xshare_img' (this will throw an Error in a future version of PHP) in wp-content/plugins/xshare/admin/panel.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/xshare/admin/office.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3 in xshare/assets to your readme.txt
Please take inspiration from this readme.txt

xshare/index.php 92% from 13 tests

"xShare" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("xshare.php" instead of "index.php")

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 detected1,116 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS31424519
SVG311301
PHP35135220
JavaScript211576

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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
assets/img/buffer-icon.png4.11KB2.10KB▼ 48.92%