87% wt-pocket-navigator

Code Review | WordsTree Pocket Navigator

WordPress plugin WordsTree Pocket Navigator scored 87% from 54 tests.

About plugin

  • Plugin page: wt-pocket-navigator
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 5.8.1
  • First release: Sep 25, 2018
  • Latest release: Oct 24, 2018
  • Number of updates: 20
  • Update frequency: every 1.6 days
  • Top authors: lotharthesavior (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 405 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼135.87ms] Passed 4 tests

Analyzing server-side resources used by WordsTree Pocket Navigator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.1337.15 ▲5.53
Dashboard /wp-admin3.26 ▲0.2040.86 ▼1.01
Posts /wp-admin/edit.php3.31 ▲0.2039.51 ▼5.87
Add New Post /wp-admin/post-new.php5.57 ▲0.1499.48 ▼535.81
Media Library /wp-admin/upload.php3.14 ▲0.1433.07 ▼0.80
WTPN Settings /wp-admin/options-general.php?page=wtpn-pocket-nav3.1128.61

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 183 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordsTree Pocket Navigator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,797 ▲20116.33 ▲0.6411.79 ▲1.2649.50 ▲0.72
Dashboard /wp-admin2,976 ▲455.86 ▼0.19137.95 ▼4.51109.07 ▲1.68
Posts /wp-admin/edit.php2,748 ▲92.71 ▲0.0160.13 ▼8.4486.03 ▼8.60
Add New Post /wp-admin/post-new.php1,557 ▼5818.46 ▼3.03382.01 ▲89.46121.04 ▼1.09
Media Library /wp-admin/upload.php1,819 ▲125.04 ▲0.01143.91 ▼13.66135.30 ▲20.09
WTPN Settings /wp-admin/options-general.php?page=wtpn-pocket-nav1,0292.3454.9571.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/wt-pocket-navigator/vendor/djchen/pocket-api-php/sample.php
    • > /wp-content/plugins/wt-pocket-navigator/admin/partials/wtpn-pocket-nav-admin-display.php
    • > /wp-content/plugins/wt-pocket-navigator/public/partials/wtpn-pocket-nav-public-display.php
  • 72× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require(): Failed opening required 'Pocket.php' (include_path='.:/usr/share/php') in wp-content/plugins/wt-pocket-navigator/vendor/djchen/pocket-api-php/sample.php on line 17
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wt-pocket-navigator/vendor/guzzlehttp/psr7/src/Stream.php:11
    • > PHP Warning
      require_once(wp-content/plugins/wt-pocket-navigator/vendor/league/oauth1-client/resources/examples/../../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wt-pocket-navigator/vendor/league/oauth1-client/resources/examples/twitter.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'League\\OAuth1\\Client\\Credentials\\Credentials' not found in wp-content/plugins/wt-pocket-navigator/vendor/league/oauth1-client/src/Client/Credentials/TokenCredentials.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/wt-pocket-navigator/vendor/guzzlehttp/psr7/src/Response.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/wt-pocket-navigator/vendor/guzzlehttp/psr7/src/ServerRequest.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'League\\OAuth1\\Client\\Signature\\Signature' not found in wp-content/plugins/wt-pocket-navigator/vendor/league/oauth1-client/src/Client/Signature/PlainTextSignature.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'League\\OAuth1\\Client\\Server\\Server' not found in wp-content/plugins/wt-pocket-navigator/vendor/league/oauth1-client/src/Client/Server/Trello.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wt-pocket-navigator/vendor/guzzlehttp/psr7/src/FnStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wt-pocket-navigator/vendor/guzzlehttp/psr7/src/AppendStream.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: widget, pocket, wordpress, plugins, utilities...

wt-pocket-navigator/wtpn-pocket-nav.php 77% from 13 tests

"WordsTree Pocket Navigator" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wt-pocket-navigator.php" instead of "wtpn-pocket-nav.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 171 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin14,080 lines of code in 164 files:
LanguageFilesBlank linesComment linesLines of code
PHP1342,4166,47610,314
Markdown141,04303,357
JSON800262
YAML24053
CSS2151051
XML10028
make1409
JavaScript24546

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.45
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces12
Interfaces17
Traits2
Classes97
▷ Abstract classes33.09%
▷ Concrete classes9496.91%
▷ Final classes77.45%
Methods886
▷ Static methods657.34%
▷ Public methods72581.83%
▷ Protected methods414.63%
▷ Private methods12013.54%
Functions156
▷ Named functions5635.90%
▷ Anonymous functions10064.10%
Constants54
▷ Global constants11.85%
▷ Class constants5398.15%
▷ Public constants53100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.62MB with 0.44MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png25.92KB7.60KB▼ 70.67%
assets/screenshot-1.png531.51KB164.87KB▼ 68.98%
assets/screenshot-2.png54.25KB14.40KB▼ 73.46%
assets/screenshot-3.png26.79KB7.57KB▼ 71.77%