@tsteur opened this Issue on October 28th 2014 Member

Makes no sense by definition. In API.php should be only methods that are callable via the HTTP API.

Instead those methods should be moved in different classes. Such as a Model or something more meaningful.

@sgiehl commented on April 21st 2020 Member

Just to be sure. That would currently include the following API methods:

  • [ ] API.getSVGLogoUrl
  • [ ] API.hasSVGLogo
  • [x] Annotations.getDateRangeForPeriod
  • [ ] CustomVariables.getReservedCustomVariableKeys
  • [x] DBStats.getArchiveTableYear
  • [ ] Events.getActionToLoadSubtables
  • [ ] Events.getDefaultSecondaryDimension
  • [ ] Events.getSecondaryDimensions
  • [ ] Goals.getConversions
  • [ ] Goals.getNbVisitsConverted
  • [ ] Goals.getConversionRate
  • [ ] Goals.getRevenue
  • [ ] LanguagesManager.getPluginTranslationsForLanguage
  • [ ] Live.getLastVisitsForVisitor
  • [x] MobileMessaging.sanitizePhoneNumber
  • [x] MobileMessaging.sendSMS
  • [x] MobileMessaging.getPhoneNumbers
  • [x] MobileMessaging.getActivatedPhoneNumbers
  • [ ] MultiSites.getApiMetrics
  • [ ] Referrers.getKeywordNotDefinedString
  • [ ] Referrers.getCleanKeyword
  • [ ] ScheduledReports.getReportMetadata
  • [ ] ScheduledReports.allowMultipleReports
  • [ ] ScheduledReports.getReportTypes
  • [ ] ScheduledReports.getReportFormats
  • [ ] ScheduledReports.getReportRecipients
  • [ ] ScheduledReports.isSegmentEditorActivated
  • [ ] SitesManager.getSitesIdFromTimezones
  • [ ] SitesManager.updateSiteCreatedTime
  • [ ] UsersManager.initUserPreferenceWithDefault
  • [ ] UsersManager.getAllUsersPreferences
  • [x] VisitsSummary.getColumns

If any of those methods shouldn't be moved, let me know.

Otherwise won't do that in one big PR, but in one PR per plugin or so. That should make it easier and faster to review.

@tsteur commented on April 21st 2020 Member

I'm now wondering how important it actually is. These methods can't be called through the API right? It doesn't seem all that important and I reckon we could close the issue if they can't be called directly through the API.

@sgiehl commented on April 22nd 2020 Member

They can't be called directly. Nevertheless it might not make any sense to have public methods in an API class that should not be callable. But if it's not important right now, I'll stop working on it for now.
Feel free to close the issue or move it to a later milestone...

@tsteur commented on April 22nd 2020 Member

Agreed it doesn't make sense but it's also not any important. It really doesn't make any difference at the end of the day. Will close it.

This Issue was closed on April 22nd 2020
Powered by GitHub Issue Mirror