10% wp-ng

Code Review | Angular for WordPress

WordPress plugin Angular for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: wp-ng
  • Plugin version: 1.7.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2016
  • Latest release: Mar 12, 2019
  • Number of updates: 35
  • Update frequency: every 24.5 days
  • Top authors: redcastor (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /6,096 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp-ng/includes/class-wp-ng-helper.php+297
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲5.94MB] [CPU: ▲43.74ms] 75% from 4 tests

Server-side resources used by Angular for WordPress
Please take the time to fix the following items
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.94MB on /wp-admin/options-general.php?page=settings_wp-ng)
PageMemory (MB)CPU Time (ms)
Home /9.89 ▲6.4398.70 ▲54.00
Dashboard /wp-admin9.97 ▲6.63106.91 ▲44.19
Posts /wp-admin/edit.php9.97 ▲6.6299.51 ▲43.17
Add New Post /wp-admin/post-new.php9.97 ▲4.09159.11 ▲40.25
Media Library /wp-admin/upload.php9.97 ▲6.7484.05 ▲47.34
WP NG Angular /wp-admin/options-general.php?page=settings_wp-ng9.9876.04

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 1,072 new files
Database: no new tables, 13 new options
New WordPress options
db_upgraded
wp-ng_log_file
widget_recent-posts
wp-ng_version
widget_recent-comments
wp-ng_log_rollbar
wp-ng_advanced
wp-ng_scripts
theysaidso_admin_options
wp-ng_general
...

Browser metrics 75% from 4 tests

An overview of browser requirements for Angular for WordPress
It is time to focus on the following
  • Nodes: Limit the number of DOM nodes under 25,000 (currently 44,520 on /wp-admin/options-general.php?page=settings_wp-ng)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,339 ▲59316.58 ▲2.2345.91 ▲44.2941.25 ▼1.36
Dashboard /wp-admin2,358 ▲1776.36 ▲0.58117.10 ▲14.6437.52 ▼6.63
Posts /wp-admin/edit.php2,285 ▲1823.54 ▲1.4056.62 ▲17.3937.37 ▲2.58
Add New Post /wp-admin/post-new.php1,545 ▲1923.08 ▲0.01641.99 ▼7.6834.16 ▼18.36
Media Library /wp-admin/upload.php1,423 ▲204.42 ▲0.2184.58 ▼22.5245.02 ▼2.53
WP NG Angular /wp-admin/options-general.php?page=settings_wp-ng44,5207.77693.5866.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 25160 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=settings_wp-ng
    • > Notice in wp-content/plugins/wp-ng/includes/class-wp-ng-settings.php+1523
    Trying to access array offset on value of type bool

SRP 50% 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
Please fix the following
  • 96× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wp-ng/lib/Monolog/Handler/MailHandler.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/wp-ng/lib/Monolog/Formatter/JsonFormatter.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\\JsonFormatter' not found in wp-content/plugins/wp-ng/lib/Monolog/Formatter/LogglyFormatter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wp-ng/lib/Monolog/Handler/FirePHPHandler.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\GroupHandler' not found in wp-content/plugins/wp-ng/lib/Monolog/Handler/WhatFailureGroupHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-ng/includes/wp-ng-settings-descriptor.php:465
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/wp-ng/lib/Monolog/Formatter/ElasticaFormatter.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/wp-ng/lib/Monolog/Formatter/HtmlFormatter.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-ng/admin/partials/gallery-view.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wp-ng/lib/Monolog/Handler/TestHandler.php:66

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: You are using too many tags: 24 tag instead of maximum 10
The official readme.txt might help

wp-ng/wp-ng.php Passed 13 tests

The principal PHP file in "Angular for WordPress" v. 1.7.8 is loaded by WordPress automatically on each request
129 characters long description:
WP NG is a Angular bootstrapper for wordpress. The plugin do automatic bootstrap your app and add module dependencie in your app.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected83,927 lines of code in 658 files:
LanguageFilesBlank linesComment linesLines of code
PHP2616,55611,37325,421
JSON110024,202
JavaScript2441,16561023,323
Sass426481604,303
SVG132513,055
CSS82538791,907
Markdown32380969
PO File1286469740
XML1007

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity14.03
▷ Minimum class complexity1.00
▷ Maximum class complexity228.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces18
Interfaces13
Traits2
Classes183
▷ Abstract classes84.37%
▷ Concrete classes17595.63%
▷ Final classes31.71%
Methods1,552
▷ Static methods23014.82%
▷ Public methods1,16274.87%
▷ Protected methods22414.43%
▷ Private methods16610.70%
Functions161
▷ Named functions10464.60%
▷ Anonymous functions5735.40%
Constants108
▷ Global constants1715.74%
▷ Class constants9184.26%
▷ Public constants91100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
180 PNG files occupy 0.41MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/vendor/galleria/themes/fullscreen/p-neg.png0.96KB0.12KB▼ 87.76%
public/assets/vendor/galleria/themes/fullscreen/i.png0.17KB0.14KB▼ 20.11%
public/dist/vendor/unitegallery/skins/alexis/images/slider_arrow_left.png1.78KB0.89KB▼ 50.25%
public/assets/images/icon-256x256.png35.40KB15.01KB▼ 57.60%
public/dist/vendor/unitegallery/skins/default/button_playpause.png0.59KB0.62KB0.00%