62% narnoo-operator-plugin

Code Review | Narnoo Operator

WordPress plugin Narnoo Operator scored62%from 54 tests.

About plugin

  • Plugin page: narnoo-operator-p...
  • Plugin version: 2.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.2.3
  • WordPress version: 6.3.1
  • First release: Jan 21, 2013
  • Latest release: Sep 19, 2019
  • Number of updates: 51
  • Update frequency: every 47.8 days
  • Top authors: Narnoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,181 total downloads

Benchmarks

Plugin footprint 65% from 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▲7.10ms] Passed 4 tests

Server-side resources used by Narnoo Operator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2046.29 ▲3.85
Dashboard /wp-admin3.57 ▲0.2758.25 ▲8.49
Posts /wp-admin/edit.php3.66 ▲0.3162.39 ▲10.71
Add New Post /wp-admin/post-new.php6.17 ▲0.2996.24 ▲5.33
Media Library /wp-admin/upload.php3.49 ▲0.2645.39 ▲12.00
Add New /wp-admin/post-new.php?post_type=narnoo_product3.4139.98
Images /wp-admin/admin.php?page=narnoo-operator-images3.4441.54
Narnoo /wp-admin/admin.php?page=narnoo-operator-followers3.5140.97
Narnoo API /wp-admin/options-general.php?page=narnoo-operator-api-settings3.4339.87
Products /wp-admin/edit.php?post_type=narnoo_product3.5246.53
Albums /wp-admin/admin.php?page=narnoo-operator-albums3.3634.06
Videos /wp-admin/admin.php?page=narnoo-operator-videos3.4437.99
Products /wp-admin/admin.php?page=narnoo-operator-products3.4440.93
Print /wp-admin/admin.php?page=narnoo-operator-brochures3.4438.56

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Narnoo Operator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲12214.38 ▼0.211.73 ▲0.0342.71 ▼0.56
Dashboard /wp-admin2,286 ▲1065.74 ▲0.0586.06 ▼0.8969.94 ▲31.02
Posts /wp-admin/edit.php2,194 ▲942.38 ▲0.3635.27 ▼2.3635.51 ▲0.40
Add New Post /wp-admin/post-new.php1,606 ▲7423.44 ▼0.20752.47 ▲72.3663.17 ▲10.38
Media Library /wp-admin/upload.php1,491 ▲944.46 ▲0.25107.44 ▼3.6883.05 ▲33.84
Add New /wp-admin/post-new.php?post_type=narnoo_product3,2949.58262.90147.37
Images /wp-admin/admin.php?page=narnoo-operator-images1,0361.8627.5431.81
Narnoo /wp-admin/admin.php?page=narnoo-operator-followers8781.8428.9626.55
Narnoo API /wp-admin/options-general.php?page=narnoo-operator-api-settings9221.8429.1229.98
Products /wp-admin/edit.php?post_type=narnoo_product1,1762.2034.5132.55
Albums /wp-admin/admin.php?page=narnoo-operator-albums1,0471.8730.1730.67
Videos /wp-admin/admin.php?page=narnoo-operator-videos1,0391.8630.2030.62
Products /wp-admin/admin.php?page=narnoo-operator-products1,0351.8732.7228.89
Print /wp-admin/admin.php?page=narnoo-operator-brochures1,0361.8628.3730.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'NarnooOperator' not found
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=narnoo_product
    • > Notice in wp-content/plugins/narnoo-operator-plugin/narnoo-operator.php+1462
    Undefined index: check_meta
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-brochures
    • > Notice in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/3.0.0/phpfastcache.php+159
    Undefined index: securityKey
    • > GET request to /wp-admin/post-new.php?post_type=narnoo_product
    • > Notice in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/3.0.0/phpfastcache.php+202
    Undefined index: default_chmod
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-brochures
    • > Notice in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/3.0.0/phpfastcache.php+193
    Undefined index: htaccess
    • > GET request to /wp-admin/post-new.php?post_type=narnoo_product
    • > Notice in wp-content/plugins/narnoo-operator-plugin/narnoo-operator.php+955
    Undefined variable: list
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-brochures
    • > Notice in wp-content/plugins/narnoo-operator-plugin/class-narnoo-operator-brochures-table.php+407
    Trying to get property 'data' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-albums
    • > Notice in wp-content/plugins/narnoo-operator-plugin/class-narnoo-operator-albums-table.php+143
    Trying to get property 'albums' of non-object
    • > GET request to /wp-admin/post-new.php?post_type=narnoo_product
    • > Warning in wp-content/plugins/narnoo-operator-plugin/narnoo-operator.php+955
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-images
    • > Notice in wp-content/plugins/narnoo-operator-plugin/class-narnoo-operator-images-table.php+649
    Trying to get property 'images' of non-object
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-followers
    • > Notice in wp-content/plugins/narnoo-operator-plugin/libs/html/help_info_tpl.php+5
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=narnoo-operator-api-settings
    • > Notice in wp-content/plugins/narnoo-operator-plugin/narnoo-operator.php+519
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-videos
    • > Notice in wp-content/plugins/narnoo-operator-plugin/class-narnoo-operator-videos-table.php+205
    Trying to get property 'videos' of non-object
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-products
    • > Notice in wp-content/plugins/narnoo-operator-plugin/class-narnoo-operator-products-table.php+188
    Trying to get property 'products' of non-object
    • > GET request to /wp-admin/admin.php?page=narnoo-operator-brochures
    • > Notice in wp-content/plugins/narnoo-operator-plugin/class-narnoo-operator-brochures-table.php+407
    Trying to get property 'prints' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/Narnoo/Authenticate/Authenticate.php
    • > /wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/Narnoo/Booking/Booking.php
    • > /wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/Narnoo/Business/Business.php
    • > /wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/Narnoo/Connect/Connect.php
    • > /wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/Narnoo/Product/Product.php
    • > /wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/Narnoo/Access/Access.php
    • > /wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/Narnoo/Media/Media.php
  • 353× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/vendor/guzzlehttp/psr7/src/Request.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Command/ServerBackgroundRewriteAOF.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\KeyTimeToLive' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Command/KeyPreciseTimeToLive.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Response\\ErrorInterface' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Response/Error.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/narnoo-operator-plugin/libs/narnoo-php-sdk/vendor/guzzlehttp/psr7/src/FnStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Command/ServerMonitor.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Command/HyperLogLogMerge.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Command/SetCardinality.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Command/SetIntersectionStore.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/narnoo-operator-plugin/libs/cache/phpfastcache/_extensions/predis-1.0/src/Command/PubSubPubsub.php:18

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 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5, #6 in narnoo-operator-plugin/assets to your readme.txt
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

narnoo-operator-plugin/narnoo-operator.php 85% from 13 tests

The main PHP script in "Narnoo Operator" version 2.2.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("narnoo-operator-plugin.php" instead of "narnoo-operator.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 252 characters long)

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
Everything looks great! No dangerous files found in this plugin80,969 lines of code in 640 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP4658,74120,19330,066
CSS1810,5691,41111,920
Markdown171,54404,814
JavaScript93285081,386
JSON700425
INI16624
make1409
HTML2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity9.05
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces33
Interfaces40
Traits2
Classes399
▷ Abstract classes205.01%
▷ Concrete classes37994.99%
▷ Final classes82.11%
Methods2,356
▷ Static methods2018.53%
▷ Public methods1,94382.47%
▷ Protected methods27411.63%
▷ Private methods1395.90%
Functions201
▷ Named functions9748.26%
▷ Anonymous functions10451.74%
Constants88
▷ Global constants1314.77%
▷ Class constants7585.23%
▷ Public constants75100.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
16 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/CMB2/images/ico-delete.png0.70KB0.72KB0.00%
libs/CMB2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
libs/CMB2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
images/icon-16.png0.75KB0.86KB0.00%
libs/CMB2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%