Post Pay Counter

The best way to pay authors on WordPress

  • Features
    • PRO version
  • Cart
    • Addons
  • Documentation
  • Support

Shortcode frontend Statistiche. “All Time” non funziona.

by

› Forums › Post Pay Counter PRO › Support › Shortcode frontend Statistiche. “All Time” non funziona.

We are based in Europe with a GMT+1/GMT+2 time zone - support replies may be delayed due to time zone differences with your country.

  • This topic has 17 replies, 1 voice, and was last updated 4 years, 7 months ago by Stefano.
Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • October 1, 2020 at 7:34 am #77897
    Alessandro
    Guest

    Ciao Stefano, ho notato che lo shortcode che mostra le statistiche nel frontend non mi funziona, ti spiego meglio. Se vado a visualizzare le statistiche nel frontend e premo su all time mi mostra le statistiche dei post creati a partire dal mese di maggio 05/2020 ( solo 46 post mi mostra ) ,quando io ho scritto post a partire dal marzo del 2019 per un totale di 430 post. In altre parole se premo all time mi mostra solo 46 post quando io ne ho scritti 430 in totale.

    È possibile che ci sia qualche errore nello shortcode, nel punto dove vengono impostate le date di settaggio Statistiche?

    Time range shortcuts coming from shortcode args
    $time_range_text = __( ‘Default’, ‘ppcp’ );
    if( $time_range != NULL AND ! empty( $time_range ) ) {
    if( $time_range == ‘last_month’ ) {
    $tstart = strtotime( “first day of previous month” ); //AMAZING
    $tend = strtotime( “last day of previous month” );
    $time_range_text = __( ‘Last Month’, ‘post-pay-counter’ );
    } else if( $time_range == ‘current_month’ ) {
    $tstart = strtotime( “first day of this month” );
    $tend = strtotime( “last day of this month” );
    $time_range_text = __( ‘This Month’, ‘post-pay-counter’ );
    } else if( $time_range == ‘last_week’ ) {
    $tstart = strtotime( ‘Monday this week’ );
    $tstart = strtotime( ‘-1 week’, $tstart );
    $tend = $tstart + 6*86400;
    $time_range_text = __( ‘This Week’, ‘post-pay-counter’ );
    } else if( $time_range == ‘all_time’ ) {
    $tstart = $ppc_global_settings[‘first_available_post_time’];
    $tend = $ppc_global_settings[‘last_available_post_time’];
    $time_range_text = __( ‘All Time’, ‘post-pay-counter’ );
    }

    //Provide text label for default stats time range
    } else {
    if( $general_settings[‘default_stats_time_range_month’] )
    $time_range_text = __( ‘This Month’, ‘post-pay-counter’ );
    else if( $general_settings[‘default_stats_time_range_last_month’] )
    $time_range_text = __( ‘Last Month’, ‘post-pay-counter’ );
    else if( $general_settings[‘default_stats_time_range_week’] )
    $time_range_text = __( ‘This Week’, ‘post-pay-counter’ );
    else if( $general_settings[‘default_stats_time_range_this_year’] )
    $time_range_text = __( ‘This Year’, ‘post-pay-counter’ );
    else if( $general_settings[‘default_stats_time_range_all_time’] )
    $time_range_text = __( ‘All Time’, ‘post-pay-counter’ );
    else if( $general_settings[‘default_stats_time_range_custom’] )
    $time_range_text = date_i18n( get_option( ‘date_format’ ), $tstart ).’ – ‘.date_i18n( get_option( ‘date_format’ ), $tend );
    }
    }

    if( isset( $_GET[‘ppc_time_range’] ) ) {
    switch( $_GET[‘ppc_time_range’] ) {
    case ‘this_month’:
    $tstart = strtotime( ‘first day of this month’ );
    $tend = strtotime( ’23:59:59′ );
    $time_range_text = __( ‘This Month’, ‘post-pay-counter’ );
    break;

    case ‘last_month’:
    $tstart = strtotime( ‘first day of last month’ );
    $tend = strtotime( ‘first day of this month’ ) – 86400;
    $time_range_text = __( ‘Last Month’, ‘post-pay-counter’ );
    break;

    case ‘this_week’:
    $tstart = get_weekstartend( current_time(‘mysql’) );
    $tstart = $tstart[‘start’];
    $tend = strtotime( ’23:59:59′ );
    $time_range_text = __( ‘This Week’, ‘post-pay-counter’ );
    break;

    case ‘this_year’:
    $tstart = strtotime( ‘first day of january this year’ );
    $tend = strtotime( ’23:59:59′ );
    $time_range_text = __( ‘This Year’, ‘post-pay-counter’ );
    break;

    case ‘all_time’:
    $tstart = $ppc_global_settings[‘first_available_post_time’];
    $tend = $ppc_global_settings[‘last_available_post_time’];
    $time_range_text = __( ‘All Time’, ‘post-pay-counter’ );
    break;
    }
    }

    Come posso risolvere il problema?

    Grazie.

    October 1, 2020 at 7:35 am #77927
    Stefano
    Keymaster

    Ciao Alessandro,
    la corrispondente opzione nella pagina in wp-admin dà i risultati corretti, o è anche lei parziale?

    Buona giornata,
    Stefano

    October 1, 2020 at 7:54 am #77929
    Alessandro
    Guest

    In wp-admin se faccio la ricerca per visualizzazione articoli “all time” e filtro come “utente” il mio user, mi mostra totale 430 elementi e 2 pagine. l’elenco in prima pagina con i post fino al 19-06 ma se clicco su pagina 2 non carica la lista con i post successivi, ma mi ritorna a page=ppc-stats invece di page=ppc-stats&paged=2.

    October 1, 2020 at 7:58 am #77932
    Alessandro
    Guest

    Anche se utilizzo come filtro “personalizzato” date dal 01/01/2019 fino ad oggi e come utente il mio, mostra 430 post, la prima pagina è corretta, ma la seconda non viene caricata, quando clicco su 2 mi ritorna a ppc-stats&paged=1

    October 1, 2020 at 8:03 am #77934
    Stefano
    Keymaster

    Oh wow, che strano! Potresti provare a disabilitare tutti gli altri plugin un istante, lasciando solo Post Pay Counter, e vedere se almeno il problema della paginazione si risolve?

    October 1, 2020 at 8:19 am #77936
    Alessandro
    Guest

    Se esporto i dati con la visualizzazione sopra descritta https://postpaycounter.com/forums2/topic/shortcode-frontend-statistiche-all-time-non-funziona/#post-77929 ci sono tutti i post. Sinceramente per quanto riguarda la paginazione del backend mi interessa poco perché generalmente essendo molti dati utilizzo sempre esporta. Mi interessa lo shortcode perché gli utenti visualizzano le stats dal frontend e proprio ieri mi è stato segnalato da un utente che aveva scritto un ultimo post nel 2019,ha cliccato su intera durata e gli ha riportato query nulla, quindi non ha modo di vedere la lista di tutti i post che ha scritto e di conseguenza richiedere un pagamento, perché all tima non funziona. Ho ovviato facendo aprire le statistiche (impostando dal backend personalizzato dal 01/01/2019 ad oggi) e così i post me li mostra tutti in frontend,pero nel momento in cui cambia filtro e clicca su intera durata, non mostra tutti i post ( a me ne mostra 46 invece di 430 e all’utente 0 invece di 13). Grazie.

    October 1, 2020 at 8:25 am #77938
    Stefano
    Keymaster

    Va bene – grazie per tutte le informazioni, faccio un po’ di test e ti faccio sapere 🙂

    October 1, 2020 at 8:30 am #77940
    Alessandro
    Guest

    Sei gentilissimo, grazie ?. Attendo tue. P.S. anche con i plugin disattivati la paginazione backend non mi funziona e il front end tutto uguale a quanti sopra descritto.

    October 1, 2020 at 10:03 am #77944
    alessandro
    Guest
    This reply has been marked as private.
    October 1, 2020 at 10:12 am #77946
    Stefano
    Keymaster

    Puoi provare a sostituire la riga
    $tstart = $ppc_global_settings['first_available_post_time'];
    con
    $tstart = strtotime( '2019-01-01 00:00:01' );
    dovrebbe funzionare!

    October 1, 2020 at 10:26 am #77948
    alessandro
    Guest

    Grazie Stefano, ho sostituito le due righe:

    $tstart = $ppc_global_settings[‘first_available_post_time’]; in ppcp_shortcode_class.php con

    $tstart = strtotime( ‘2019-01-01 00:00:01’ );

    e adesso quando clicco su all time mostra tutte le statistiche.

    Il problema è momentaneamente risolto. Grazie ancora, buona giornata e buon lavoro.

    October 4, 2020 at 5:34 am #78126
    Stefano
    Keymaster

    Ciao Alessandro,
    sembra che sia riuscito a risolvere il problema. Sarebbe meraviglioso se riuscissi a darmi conferma. La patch è questa, si tratta di sostituire due righe nel file ppc_general_functions_class.php:
    https://github.com/TheCrowned/Post-Pay-Counter/pull/40/commits/61953be703984bcfd19d77e9a9bbe037a3cabbc1

    Fammi sapere 🙂
    Buona giornata,
    Stefano

    October 4, 2020 at 7:53 am #78130
    Alessandro
    Guest

    Ciao Stefano, sono fuori per il weekend e rientro oggi in tarda serata.

    Domani mattina appena mi sveglio sostituisco le righe in classes/ppc_generate_stats_class.php e in classes/ppc_general_functions_class.php poi ti faccio sapere subito appena verificato. Ho visto che sono quei due file sopra citati da modificare.

    Grazie e buona domenica.

    October 4, 2020 at 8:37 am #78134
    Stefano
    Keymaster

    Ma certo, non c’è fretta. Le modifiche al file ppc_generate_stats_class.php risolvono un altro problema, non è necessario modificarlo se non desideri 🙂

    October 4, 2020 at 5:37 pm #78153
    alessandro
    Guest

    Ok Stefano, domani faro’ un test sostituendo le 2 righe in classes/ppc_general_functions_class.php, puoi solo dirmi quale problema risolvono nello specifico tra quelli che ti ho esposto sopra? Al fine di testarlo correttamente.

    Per quanto riguarda il problema che premendo “all time” nello shortcode non riportava tutti i post dall’inizio avevo ovviato con questa modifica

    $tstart = $ppc_global_settings[‘first_available_post_time’]; in ppcp_shortcode_class.php con
    $tstart = strtotime( ‘2019-01-01 00:00:01’ );

    che funziona perfettamente.

    Grazie.

    October 4, 2020 at 9:01 pm #78163
    Stefano
    Keymaster

    Il problema risolto è quello del selezionare “All time” dallo shortcode 🙂

    October 5, 2020 at 7:47 am #78170
    Alessandro
    Guest

    Ciao Stefano, ho tolto le righe $tstart = $ppc_global_settings[‘first_available_post_time’]; in ppcp_shortcode_class.php con
    $tstart = strtotime( ‘2019-01-01 00:00:01’ ); che avevo modificato e le ho reimpostate com’erano inizialmente, poi ho sostituito le due righe if( $last_available_post->no_found_rows === false ) come da tue indicazioni e ho testato il click su “All Time” delle shortcode nel frontend e funziona perfettamente, quindi ti confermo che così il problema è stato risolto.

    Grazie, buon lavoro.

    October 5, 2020 at 1:57 pm #78183
    Stefano
    Keymaster

    Meraviglioso, grazie per la conferma! 🙂

  • Author
    Posts
Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Shortcode frontend Statistiche. “All Time” non funziona.’ is closed to new replies.

Your cart

Number of items in cart: 0

  • Your cart is empty.
  • Total: €0.00
  • Checkout

What are you looking for?

BEFORE POSTING

Before posting, please please please do have a look at our Documentation section. Your problem may be addressed there, allowing you to solve it without help from us :)

Copyright © 2025 · Centric Theme on Genesis Framework · WordPress · Log in