48, "defaultCountry" => "us", "defaultStars" => 5, "defaultRecent" => 10 ); add_option("asrv_options", $options); //Cache directory mkdir(ASRV_CACHE_DIR, 0777); } function asrv_uninstall() { delete_option("asrv_options"); } /* Menu page */ //Shortcut to the Admin page add_filter('plugin_action_links', 'asrv_plugin_action_links', 10, 2); function asrv_plugin_action_links($links, $plugin_file) { static $plugin; if (!isset($plugin)) { $plugin = "appstore-reviews-viewer/appstore-review.php"; } if ($plugin == $plugin_file) { $settings_link = 'Settings'; array_unshift($links, $settings_link); } return $links; } //Menu add_action('admin_init', 'asrv_register_settings_and_fields'); add_action('admin_menu', 'asrv_admin_page'); function asrv_admin_page() { add_options_page('AppStore Reviews Viewer - Options', 'AppStore Reviews Viewer', 'manage_options', __FILE__, 'asrv_render_admin_form'); } function asrv_register_settings_and_fields() { register_setting('asrv_options','asrv_options'); add_settings_section('asrv_plugin_main_section', 'Main Settings', 'asrv_plugin_cb', __FILE__); add_settings_field('cache', 'Cache Time: ', 'asrv_form_option_cache', __FILE__, 'asrv_plugin_main_section'); add_settings_field('defaultCountry', 'AppStore Country: ', 'asrv_form_option_country', __FILE__, 'asrv_plugin_main_section'); add_settings_field('defaultStars', 'Retrieve reviews with at least: ', 'asrv_form_option_stars', __FILE__, 'asrv_plugin_main_section'); add_settings_field('defaultRecent', 'Show only last X reviews: ', 'asrv_form_option_recent', __FILE__, 'asrv_plugin_main_section'); } function asrv_plugin_cb() { echo "Those are the default parameters for all the shortcodes you use on your site. You can override those parameters for any shortcode (except the cache)."; } function asrv_form_option_cache() { $options = get_option("asrv_options"); $caches = array( "0" => "Don't cache", "1" => "1 hour", "6" => "6 hours", "12" => "12 hours", "24" => "1 day", "48" => "2 days", "168" => "1 week" ); echo ""; echo "This option determines how long before the plugin requests new data from Apple's servers."; } function asrv_form_option_country() { $options = get_option("asrv_options"); $countries = array( "AL" => "Albania", "DZ" => "Algeria", "AO" => "Angola", "AI" => "Anguilla", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "AM" => "Armenia", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaijan", "BS" => "Bahamas", "BH" => "Bahrain", "BB" => "Barbados", "BY" => "Belarus", "BE" => "Belgium", "BZ" => "Belize", "BJ" => "Benin", "BM" => "Bermuda", "BT" => "Bhutan", "BO" => "Bolivia", "BW" => "Botswana", "BR" => "Brazil", "BN" => "Brunei Darussalam", "BG" => "Bulgaria", "BF" => "Burkina Faso", "KH" => "Cambodia", "CA" => "Canada", "CV" => "Cape Verde", "KY" => "Cayman Islands", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CO" => "Colombia", "CG" => "Congo, Republic of the", "CR" => "Costa Rica", "HR" => "Croatia", "CY" => "Cyprus", "CZ" => "Czech Republic", "DK" => "Denmark", "DM" => "Dominica", "DO" => "Dominican Republic", "EC" => "Ecuador", "EG" => "Egypt", "SV" => "El Salvador", "EE" => "Estonia", "FJ" => "Fiji", "FI" => "Finland", "FR" => "France", "GM" => "Gambia", "DE" => "Germany", "GH" => "Ghana", "GR" => "Greece", "GD" => "Grenada", "GT" => "Guatemala", "GW" => "Guinea-Bissau", "GY" => "Guyana", "HN" => "Honduras", "HK" => "Hong Kong", "HU" => "Hungary", "IS" => "Iceland", "IN" => "India", "ID" => "Indonesia", "IE" => "Ireland", "IL" => "Israel", "IT" => "Italy", "JM" => "Jamaica", "JP" => "Japan", "JO" => "Jordan", "KZ" => "Kazakhstan", "KE" => "Kenya", "KR" => "Korea, Republic Of", "KW" => "Kuwait", "KG" => "Kyrgyzstan", "LA" => "Lao, People's Democratic Republic", "LV" => "Latvia", "LB" => "Lebanon", "LR" => "Liberia", "LT" => "Lithuania", "LU" => "Luxembourg", "MO" => "Macau", "MK" => "Macedonia", "MG" => "Madagascar", "MW" => "Malawi", "MY" => "Malaysia", "ML" => "Mali", "MT" => "Malta", "MR" => "Mauritania", "MU" => "Mauritius", "MX" => "Mexico", "FM" => "Micronesia, Federated States of", "MD" => "Moldova", "MN" => "Mongolia", "MS" => "Montserrat", "MZ" => "Mozambique", "NA" => "Namibia", "NP" => "Nepal", "NL" => "Netherlands", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger", "NG" => "Nigeria", "NO" => "Norway", "OM" => "Oman", "PK" => "Pakistan", "PW" => "Palau", "PA" => "Panama", "PG" => "Papua New Guinea", "PY" => "Paraguay", "PE" => "Peru", "PH" => "Philippines", "PL" => "Poland", "PT" => "Portugal", "QA" => "Qatar", "RO" => "Romania", "RU" => "Russia", "ST" => "São Tomé and Príncipe", "SA" => "Saudi Arabia", "SN" => "Senegal", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SK" => "Slovakia", "SI" => "Slovenia", "SB" => "Solomon Islands", "ZA" => "South Africa", "ES" => "Spain", "LK" => "Sri Lanka", "KN" => "St. Kitts and Nevis", "LC" => "St. Lucia", "VC" => "St. Vincent and The Grenadines", "SR" => "Suriname", "SZ" => "Swaziland", "SE" => "Sweden", "CH" => "Switzerland", "TW" => "Taiwan", "TJ" => "Tajikistan", "TZ" => "Tanzania", "TH" => "Thailand", "TT" => "Trinidad and Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "TC" => "Turks and Caicos", "UG" => "Uganda", "GB" => "United Kingdom", "UA" => "Ukraine", "AE" => "United Arab Emirates", "UY" => "Uruguay", "US" => "USA", "UZ" => "Uzbekistan", "VE" => "Venezuela", "VN" => "Vietnam", "VG" => "Virgin Islands, British", "YE" => "Yemen", "ZW" => "Zimbabwe" ); echo ""; echo "This option determines which AppStore country you want to download the reviews from."; } function asrv_form_option_stars() { $options = get_option("asrv_options"); $stars = array( "1" => "1 star", "2" => "2 stars", "3" => "3 stars", "4" => "4 stars", "5" => "5 stars" ); echo ""; } function asrv_form_option_recent() { $options = get_option("asrv_options"); $recent = array(5, 10, 15, 20, 25); echo ""; } function asrv_render_admin_form() { ?>
Flattr this

Welcome to the AppStore Reviews Viewer - Settings Page

Here, you will be able to specify some settings for the plugin.


Usage of the shortcode

Minimal configuration

[ios_app_review id="12345678"] where 12345678 is the ID of your app on the AppStore.

Full configuration

[ios_app_review id="12345678" country="us" minstar="4" recent="10"]