• Resolved th3no0b

    (@th3no0b)


    The external API seems to have very few options (I only see the ability to get the plugin version?), so I used the variables.php file instead of external.php so that I could load monthly pageviews and visitors, however I had to add an extra elseif to get pageviews. Is it possible to get this extra elseif in by default? Or should I just change all my sites’ variables.php to add in the extra statement?

    Thanks

    The extra elseif:

    elseif ($var=='monthtotalpageviews'){
        $qry = $wpdb->get_results(
          "SELECT count(id) AS pageview
           FROM $table_name
           WHERE
            DATE >= DATE_FORMAT(CURDATE(), '%Y%m01') AND
            spider='' and feed='';
          ");
       if ($qry != null) {
         echo $qry[0]->pageview;
       }
    }

    https://wordpress.org/plugins/newstatpress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor lechab

    (@lechab)

    Hi th3no0b,

    The external API is not yet fully developed.

    I will not spoke instead of ice00, but the API will probably include other parameters than the version of the website 😉
    I let him reply you more precisely;

    cHab

    Plugin Author ice00

    (@ice00)

    hi,

    variables.php is for getting some values from the DB inside WordPress where the server is running.

    external.php is for getting values from the DB to external server where WordPress could be not installed.

    In your case it is better to modify the variables.php and get that value (it will be in version 1.1.0).

    Just to speak about external API. It has now only ‘version’ as I use it in Multi-Newstatpress to monitored my 11 sites for easy update them at every plugin update and test that it works correctly.

    In version 1.1.0 it will be modified:

    • the MD5 key testing has an errors and it is fixed (it needs to modify the API call for people that already use it).
    • API now has more calling paramethers and two options: JSON ad HTML output. With the first you get the data and with the second you get the data formatted in HTML, so Newstatpress can use it for rendering the data via AJAX in an async way.

    Actually I’m testing the Dashboard generation via external API inside Multi-Newstatpress. It has some minor points to fix and then 1.1.0 can be released with the first important API usage.

    Thanks

    Plugin Author ice00

    (@ice00)

    I just forget: newstatpress develoup is here:

    https://github.com/lechab/newstatpress

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘API Suggestion/Help’ is closed to new replies.