Skip to content

Add react pages and assets, blocks, and admin page registration#3

Merged
KMchaudhary merged 4 commits into
masterfrom
feat/react-pages
Dec 11, 2024
Merged

Add react pages and assets, blocks, and admin page registration#3
KMchaudhary merged 4 commits into
masterfrom
feat/react-pages

Conversation

@KMchaudhary
Copy link
Copy Markdown
Collaborator

  • Add a pages directory to add individual React roots and bundle the files.
  • Add EasyDAM and Video Editor admin pages.
  • Add classes to enqueue scripts and styles, and class for page to register admin pages and enqueue related styles and scripts, integrate TailwindCSS.

@KMchaudhary KMchaudhary requested a review from elifvish December 11, 2024 12:51
@KMchaudhary KMchaudhary self-assigned this Dec 11, 2024
rtBot

This comment was marked as resolved.

rtBot

This comment was marked as resolved.

rtBot
rtBot previously requested changes Dec 11, 2024
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
Comment thread inc/classes/class-pages.php Outdated
rtBot

This comment was marked as resolved.

rtBot

This comment was marked as resolved.

rtBot

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-plugin.php Outdated
}

return $form_fields;
}, 10, 2);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Closing parenthesis of a multi-line function call must be on a line by itself (PEAR.Functions.FunctionCallSignature.CloseBracketLine).

Comment thread inc/classes/class-plugin.php Outdated
*/
public function load_post_types() {

// Load all post types.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: There must be no blank line following an inline comment (Squiz.Commenting.InlineComment.SpacingAfterAtFunctionEnd).


// Load all post types.

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Function closing brace must go on the next line following the body; found 1 blank lines before brace (PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose).

Comment thread inc/classes/class-plugin.php Outdated
*/
public function load_taxonomies() {

// Load all taxonomies classes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: There must be no blank line following an inline comment (Squiz.Commenting.InlineComment.SpacingAfterAtFunctionEnd).


// Load all taxonomies classes.

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Function closing brace must go on the next line following the body; found 1 blank lines before brace (PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose).

Comment thread inc/classes/class-plugin.php Outdated
*/
public function load_plugin_configs() {

// Load all plugin configs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: There must be no blank line following an inline comment (Squiz.Commenting.InlineComment.SpacingAfterAtFunctionEnd).


// Load all plugin configs.

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Function closing brace must go on the next line following the body; found 1 blank lines before brace (PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose).


}

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: The closing brace for the class must go on the next line after the body (PSR2.Classes.ClassDeclaration.CloseBraceAfterBody).

@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'e883c62807d6327fcf3c');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Missing file doc comment (Squiz.Commenting.FileComment.Missing).

@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'e883c62807d6327fcf3c');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space after the array opener in a single line array. Found: no spaces (NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine).

rtBot

This comment was marked as resolved.

rtBot
rtBot previously requested changes Dec 11, 2024
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-pages.php Outdated
if ( $screen && in_array( $screen->id, [ 'toplevel_page_easydam', 'easydam_page_video_editor' ] ) ) {
wp_register_style(
'react-pages-features-page-style-easydam',
RT_TRANSCODER_URL . '/pages/build/style.css',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
wp_register_style(
'react-pages-features-page-style-easydam',
RT_TRANSCODER_URL . '/pages/build/style.css',
[],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
wp_register_style(
'react-pages-features-page-style-easydam',
RT_TRANSCODER_URL . '/pages/build/style.css',
[],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Short array syntax is not allowed (Universal.Arrays.DisallowShortArraySyntax.Found).

Comment thread inc/classes/class-pages.php Outdated
'react-pages-features-page-style-easydam',
RT_TRANSCODER_URL . '/pages/build/style.css',
[],
filemtime( RT_TRANSCODER_PATH . '/pages/build/style.css' )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
RT_TRANSCODER_URL . '/pages/build/style.css',
[],
filemtime( RT_TRANSCODER_PATH . '/pages/build/style.css' )
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
[],
filemtime( RT_TRANSCODER_PATH . '/pages/build/style.css' )
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
filemtime( RT_TRANSCODER_PATH . '/pages/build/style.css' )
);

wp_enqueue_style( 'react-pages-features-page-style-easydam' );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
);

wp_enqueue_style( 'react-pages-features-page-style-easydam' );
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
wp_enqueue_style( 'react-pages-features-page-style-easydam' );
}

// Check if this is your custom admin page
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-pages.php Outdated
}

// Check if this is your custom admin page
if ($screen && $screen->id === 'easydam_page_video_editor') { // Replace with your page slug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis).

rtBot
rtBot previously requested changes Dec 11, 2024
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-pages.php Outdated
}

// Check if this is your custom admin page
if ($screen && $screen->id === 'easydam_page_video_editor') { // Replace with your page slug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use Yoda Condition checks, you must (WordPress.PHP.YodaConditions.NotYoda).

Comment thread inc/classes/class-pages.php Outdated
}

// Check if this is your custom admin page
if ($screen && $screen->id === 'easydam_page_video_editor') { // Replace with your page slug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis).

Comment thread inc/classes/class-pages.php Outdated
}

// Check if this is your custom admin page
if ($screen && $screen->id === 'easydam_page_video_editor') { // Replace with your page slug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-pages.php Outdated
wp_register_script(
'react-pages-features-page-script-video-editor',
RT_TRANSCODER_URL . '/pages/build/video-editor.js',
[ 'wp-element' ],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Short array syntax is not allowed (Universal.Arrays.DisallowShortArraySyntax.Found).

Comment thread inc/classes/class-pages.php Outdated
true
);

// Pass dynamic data to React using wp_localize_script
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-pages.php Outdated
wp_localize_script(
'react-pages-features-page-script-video-editor',
'videoData',
[
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Short array syntax is not allowed (Universal.Arrays.DisallowShortArraySyntax.Found).

Comment thread inc/classes/class-pages.php Outdated
'react-pages-features-page-script-video-editor',
'videoData',
[
'nonce' => wp_create_nonce( 'wp_rest' ), // WordPress nonce for API requests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-pages.php Outdated
'videoData',
[
'nonce' => wp_create_nonce( 'wp_rest' ), // WordPress nonce for API requests
'currentUserId' => get_current_user_id(), // Current user ID
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-pages.php Outdated
[
'nonce' => wp_create_nonce( 'wp_rest' ), // WordPress nonce for API requests
'currentUserId' => get_current_user_id(), // Current user ID
'currentUserRoles' => wp_get_current_user()->roles, // Current user roles
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-pages.php Outdated

wp_enqueue_script( 'react-pages-features-page-script-video-editor' );

} else if ( $screen && $screen->id === 'toplevel_page_easydam' ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Usage of ELSE IF is discouraged; use ELSEIF instead (PSR2.ControlStructures.ElseIfDeclaration.NotAllowed).

rtBot
rtBot previously requested changes Dec 11, 2024
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-pages.php Outdated

wp_enqueue_script( 'react-pages-features-page-script-video-editor' );

} else if ( $screen && $screen->id === 'toplevel_page_easydam' ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use Yoda Condition checks, you must (WordPress.PHP.YodaConditions.NotYoda).

Comment thread inc/classes/class-pages.php Outdated
wp_register_script(
'react-pages-features-page-script-easydam',
RT_TRANSCODER_URL . '/pages/build/easydam.js',
[ 'wp-element' ],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Short array syntax is not allowed (Universal.Arrays.DisallowShortArraySyntax.Found).

Comment thread inc/classes/class-pages.php Outdated
);

wp_enqueue_script( 'react-pages-features-page-script-easydam' );
} else if ( $screen && $screen->id === 'easydam_page_components' ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Usage of ELSE IF is discouraged; use ELSEIF instead (PSR2.ControlStructures.ElseIfDeclaration.NotAllowed).

Comment thread inc/classes/class-pages.php Outdated
);

wp_enqueue_script( 'react-pages-features-page-script-easydam' );
} else if ( $screen && $screen->id === 'easydam_page_components' ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use Yoda Condition checks, you must (WordPress.PHP.YodaConditions.NotYoda).

Comment thread inc/classes/class-pages.php Outdated

wp_enqueue_script( 'react-pages-features-page-script-easydam' );
} else if ( $screen && $screen->id === 'easydam_page_components' ) {
wp_register_script(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
wp_enqueue_script( 'react-pages-features-page-script-easydam' );
} else if ( $screen && $screen->id === 'easydam_page_components' ) {
wp_register_script(
'react-pages-features-page-script-wp-components',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
} else if ( $screen && $screen->id === 'easydam_page_components' ) {
wp_register_script(
'react-pages-features-page-script-wp-components',
RT_TRANSCODER_URL . '/pages/build/wp-components.js',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
wp_register_script(
'react-pages-features-page-script-wp-components',
RT_TRANSCODER_URL . '/pages/build/wp-components.js',
[ 'wp-element' ],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
wp_register_script(
'react-pages-features-page-script-wp-components',
RT_TRANSCODER_URL . '/pages/build/wp-components.js',
[ 'wp-element' ],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Short array syntax is not allowed (Universal.Arrays.DisallowShortArraySyntax.Found).

Comment thread inc/classes/class-pages.php Outdated
'react-pages-features-page-script-wp-components',
RT_TRANSCODER_URL . '/pages/build/wp-components.js',
[ 'wp-element' ],
filemtime( RT_TRANSCODER_PATH . '/pages/build/wp-components.js' ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-pages.php Outdated
RT_TRANSCODER_URL . '/pages/build/wp-components.js',
[ 'wp-element' ],
filemtime( RT_TRANSCODER_PATH . '/pages/build/wp-components.js' ),
true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
[ 'wp-element' ],
filemtime( RT_TRANSCODER_PATH . '/pages/build/wp-components.js' ),
true
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
true
);

wp_enqueue_script( 'react-pages-features-page-script-wp-components' );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
);

wp_enqueue_script( 'react-pages-features-page-script-wp-components' );
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

wp_enqueue_script( 'react-pages-features-page-script-wp-components' );
}

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Function closing brace must go on the next line following the body; found 1 blank lines before brace (PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose).


namespace Transcoder\Inc;

use \Transcoder\Inc\Traits\Singleton;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: An import use statement should never start with a leading backslash (Universal.UseStatements.NoLeadingBackslash.LeadingBackslashFound).

namespace Transcoder\Inc;

use \Transcoder\Inc\Traits\Singleton;
use \Transcoder\Inc\Pages;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: An import use statement should never start with a leading backslash (Universal.UseStatements.NoLeadingBackslash.LeadingBackslashFound).


use \Transcoder\Inc\Traits\Singleton;
use \Transcoder\Inc\Pages;
use \Transcoder\Inc\Blocks;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: An import use statement should never start with a leading backslash (Universal.UseStatements.NoLeadingBackslash.LeadingBackslashFound).

use \Transcoder\Inc\Traits\Singleton;
use \Transcoder\Inc\Pages;
use \Transcoder\Inc\Blocks;
use \Transcoder\Inc\Assets;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: An import use statement should never start with a leading backslash (Universal.UseStatements.NoLeadingBackslash.LeadingBackslashFound).

Comment thread inc/classes/class-plugin.php Outdated
Pages::get_instance();


// Add a custom "Edit Video" button for video files in the Media Library
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

rtBot
rtBot previously requested changes Dec 11, 2024
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-plugin.php Outdated


// Add a custom "Edit Video" button for video files in the Media Library
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Opening parenthesis of a multi-line function call must be the last content on the line (PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket).

Comment thread inc/classes/class-plugin.php Outdated


// Add a custom "Edit Video" button for video files in the Media Library
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments).

Comment thread inc/classes/class-plugin.php Outdated


// Add a custom "Edit Video" button for video files in the Media Library
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen).

Comment thread inc/classes/class-plugin.php Outdated


// Add a custom "Edit Video" button for video files in the Media Library
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose).

Comment thread inc/classes/class-plugin.php Outdated

// Add a custom "Edit Video" button for video files in the Media Library
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
// Check if the file is a video
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-plugin.php Outdated
// Add a custom "Edit Video" button for video files in the Media Library
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
// Check if the file is a video
$mime_type = get_post_mime_type($post->ID);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

Comment thread inc/classes/class-plugin.php Outdated
// Add a custom "Edit Video" button for video files in the Media Library
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
// Check if the file is a video
$mime_type = get_post_mime_type($post->ID);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

Comment thread inc/classes/class-plugin.php Outdated
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
// Check if the file is a video
$mime_type = get_post_mime_type($post->ID);
if (strpos($mime_type, 'video/') !== false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis).

Comment thread inc/classes/class-plugin.php Outdated
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
// Check if the file is a video
$mime_type = get_post_mime_type($post->ID);
if (strpos($mime_type, 'video/') !== false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

Comment thread inc/classes/class-plugin.php Outdated
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
// Check if the file is a video
$mime_type = get_post_mime_type($post->ID);
if (strpos($mime_type, 'video/') !== false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

rtBot
rtBot previously requested changes Dec 11, 2024
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-plugin.php Outdated
add_filter('attachment_fields_to_edit', function ($form_fields, $post) {
// Check if the file is a video
$mime_type = get_post_mime_type($post->ID);
if (strpos($mime_type, 'video/') !== false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis).

Comment thread inc/classes/class-plugin.php Outdated
// Check if the file is a video
$mime_type = get_post_mime_type($post->ID);
if (strpos($mime_type, 'video/') !== false) {
// Generate the edit video link (adjust URL as needed)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-plugin.php Outdated
$mime_type = get_post_mime_type($post->ID);
if (strpos($mime_type, 'video/') !== false) {
// Generate the edit video link (adjust URL as needed)
$edit_url = admin_url('admin.php?page=video_editor&id=' . $post->ID);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

Comment thread inc/classes/class-plugin.php Outdated
$mime_type = get_post_mime_type($post->ID);
if (strpos($mime_type, 'video/') !== false) {
// Generate the edit video link (adjust URL as needed)
$edit_url = admin_url('admin.php?page=video_editor&id=' . $post->ID);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

Comment thread inc/classes/class-plugin.php Outdated
// Generate the edit video link (adjust URL as needed)
$edit_url = admin_url('admin.php?page=video_editor&id=' . $post->ID);

// Add a new field for the Edit Video button
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Comment thread inc/classes/class-plugin.php Outdated
$edit_url = admin_url('admin.php?page=video_editor&id=' . $post->ID);

// Add a new field for the Edit Video button
$form_fields['edit_video'] = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Short array syntax is not allowed (Universal.Arrays.DisallowShortArraySyntax.Found).

Comment thread inc/classes/class-plugin.php Outdated
$form_fields['edit_video'] = [
'label' => '',
'input' => 'html',
'html' => '<a href="' . esc_url($edit_url) . '" class="button button-primary" target="_blank">Edit Video</a>',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

Comment thread inc/classes/class-plugin.php Outdated
Comment thread inc/classes/class-plugin.php Outdated
}

return $form_fields;
}, 10, 2);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments).

rtBot
rtBot previously requested changes Dec 11, 2024
Copy link
Copy Markdown
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

Comment thread inc/classes/class-pages.php Outdated
public function add_admin_pages() {
add_menu_page(
__( 'EasyDAM', 'transcoder' ),
__( 'EasyDAM', 'transcoder' ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated

add_submenu_page(
'easydam',
__( 'Video editor', 'transcoder' ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
add_submenu_page(
'easydam',
__( 'Video editor', 'transcoder' ),
__( 'Video editor', 'transcoder' ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated

if ( $screen && in_array( $screen->id, [ 'toplevel_page_easydam', 'easydam_page_video_editor' ] ) ) {
wp_register_style(
'transcoder-page-style-easydam',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
filemtime( RT_TRANSCODER_PATH . '/pages/build/style.css' )
);

wp_enqueue_style( 'transcoder-page-style-easydam' );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
wp_enqueue_script( 'transcoder-page-script-easydam' );
} else if ( $screen && $screen->id === 'easydam_page_components' ) {
wp_register_script(
'transcoder-page-script-wp-components',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

Comment thread inc/classes/class-pages.php Outdated
true
);

wp_enqueue_script( 'transcoder-page-script-wp-components' );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

@rtBot
Copy link
Copy Markdown
Contributor

rtBot commented Dec 11, 2024

GitHub API communication error. Please contact a human. (commit-ID: 9332ec7).

@rtBot rtBot dismissed stale reviews from themself December 11, 2024 14:06

Dismissing review as all inline comments are obsolete by now

@rtBot rtBot dismissed stale reviews from themself December 11, 2024 14:06

Dismissing review as all inline comments are obsolete by now

@KMchaudhary KMchaudhary merged commit 4209ee6 into master Dec 11, 2024
@KMchaudhary KMchaudhary deleted the feat/react-pages branch March 10, 2025 03:18
rtBot added a commit that referenced this pull request Jan 1, 2026
- Add permissions block to phpcs_on_pull_request.yml (contents: read, pull-requests: write)
- Add permissions block to release_on_tag.yml (contents: write)
- Add permissions block to deploy_on_push.yml (contents: read)

This follows the principle of least privilege and resolves GitHub code scanning alerts #1, #2, and #3.

Fixes: rtCamp/support#245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants