83% apoc-viewer

Code Review | APOC

WordPress plugin APOC scored83%from 54 tests.

About plugin

  • Plugin page: apoc-viewer
  • Plugin version: 1.3.0
  • PHP compatiblity: 8.0.29+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1
  • WordPress version: 6.3.1
  • First release: Jul 13, 2023
  • Latest release: Sep 8, 2023
  • Number of updates: 22
  • Update frequency: every 13.3 days
  • Top authors: famppy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /185 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼8.81ms] Passed 4 tests

This is a short check of server-side resources used by APOC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.49 ▼7.36
Dashboard /wp-admin3.34 ▲0.0448.73 ▼2.62
Posts /wp-admin/edit.php3.46 ▲0.1045.93 ▼10.47
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.50 ▼14.80
Media Library /wp-admin/upload.php3.27 ▲0.0436.89 ▼0.09

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for APOC
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,006 ▲27113.56 ▼1.055.73 ▲4.1239.32 ▼10.75
Dashboard /wp-admin2,306 ▲1184.93 ▲0.0197.73 ▼22.9675.44 ▲29.64
Posts /wp-admin/edit.php2,186 ▲942.01 ▼0.0533.19 ▼11.6130.60 ▼18.90
Add New Post /wp-admin/post-new.php6,366 ▲4,82428.14 ▲9.95900.84 ▲299.2740.45 ▼18.93
Media Library /wp-admin/upload.php1,482 ▲974.20 ▼0.06100.85 ▲3.2675.73 ▲34.40

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant APOC_POST_TYPE - assumed 'APOC_POST_TYPE' (this will throw an Error in a future version of PHP) in wp-content/plugins/apoc-viewer/php/welcome.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/apoc-viewer/php/welcome.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/apoc-viewer/php/index.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: apoc, interactive content, authoring platform, authoring tool, xr content

apoc-viewer/apoc.php 77% from 13 tests

The principal PHP file in "APOC" v. 1.3.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("apoc-viewer.php" instead of "apoc.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 208 characters long)

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
Good job! No executable or dangerous file extensions detected3,351 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
SVG2002,716
CSS3529338
PHP871318229
JavaScript2122168

PHP code Passed 2 tests

Analyzing 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.17
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods13
▷ Static methods17.69%
▷ Public methods1076.92%
▷ Protected methods00.00%
▷ Private methods323.08%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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