Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large posts lazyload #20

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Large posts lazyload #20

wants to merge 9 commits into from

Conversation

abhij89
Copy link
Collaborator

@abhij89 abhij89 commented Feb 7, 2024

No description provided.

// wp_register_script( 'selectize-js', plugins_url( 'js/selectize.min.js', __FILE__ ), array( 'jquery' ) );
// wp_enqueue_script( 'selectize-js' );

wp_register_style( 'selectize-css', 'https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css' );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

can't use cdns, download the file and use it

wp_enqueue_style( 'selectize-css' );

wp_register_script( 'selectize-js', plugins_url( 'js/selectize.min.js', __FILE__ ), array( 'jquery' ) );
wp_register_script( 'selectize-js', 'https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js', array( 'jquery' ) );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

can't use cdns, download the file and use it

@@ -452,6 +460,7 @@ function hfcm_redirect( $url = '' ) {

// Handle AJAX requests
add_action( 'wp_ajax_hfcm-request', 'hfcm_request_handler' );
add_action( 'wp_ajax_hfcm-request-example', 'hfcm_request_handler_example' );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why is it saying example?

?>

<style>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why is stying including here instead of CSS file?

$operator = 'and'; // 'and' or 'or'
$offset = 0;
if(!empty($_POST['page'])) {
$offset = 100 * sanitize_text_field($_POST['page']);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no wpnonce verification is being done

current_user_can( 'administrator' );

if ( isset( $_POST['insert'] ) ) {
// Check nonce
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nonce check missing


$offset = 0;
if(!empty($_POST['page'])) {
$offset = 100 * sanitize_text_field($_POST['page']);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this limit of 100 needs to be global and shouldn't be defined inline

@@ -0,0 +1,425 @@
// function to show dependent dropdowns for "Site Display" field.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what is this file copy????

disabledOptions.push(jQuery(this).val());
});
var data = {
action: 'hfcm-request-example',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why example??? it's a bad name

async:false,
success: function (postData) {
console.log("success");
console.log(postData);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remove all console logs

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